FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 300   



There are two ways you can convert a String into boolean in Java

  1. Using Boolean.parseBoolean(String input) - This returns primitive boolean
    String input = "true";
    boolean output = Boolean.parseBoolean(input);
    System.out.println(output);
    
  2. Using Boolean.valueOf(String input) - This returns instance of Boolean type
    String input = "true";
    Boolean output = Boolean.valueOf(input);
    System.out.println(output);
    



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News