Articles → JAVA → Boolean.Valueof() In Java

Boolean.Valueof() In Java






Purpose




String valueBoolean.valueOf() method
True (or true)True
False (or false)False
nullFalse
Other than true, false and nullFalse



Example


public class Test {
    public static void main(String[] args) {
        System.out.println(Boolean.valueOf("True"));
        System.out.println(Boolean.valueOf("False"));
        System.out.println(Boolean.valueOf(null));
        System.out.println(Boolean.valueOf("Test"));
    }
}



Output


Picture showing the output of Boolean.valueOf() in Java
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, November 22, 2017

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250