How to convert String object to Boolean object in Java

1 Answer

0 votes
package javaapplication1;

public class JavaApplication1 {
 
    public static void main(String[] args) {
  
        String s = "true";
   
        Boolean b = Boolean.valueOf(s);
        System.out.println(b);
    }
}
 
/*
    
run:

true

*/

 



answered Nov 4, 2016 by avibootz

Related questions

1 answer 157 views
1 answer 178 views
1 answer 147 views
3 answers 260 views
1 answer 139 views
139 views asked Mar 24, 2021 by avibootz
1 answer 199 views
1 answer 160 views
160 views asked Oct 28, 2016 by avibootz
...