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



Click to Enlarge


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

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250