Java Boolean.valueOf(boolean b)
Syntax
Boolean.valueOf(boolean b) has the following syntax.
public static Boolean valueOf(boolean b)
Example
In the following code shows how to use Boolean.valueOf(boolean b) method.
/*from w w w . j a v a2s . c om*/
public class Main {
public static void main(String[] args) {
boolean bool1 = true;
boolean bool2 = false;
Boolean b1 = Boolean.valueOf(bool1);
Boolean b2 = Boolean.valueOf(bool2);
System.out.println( b1 );
System.out.println( b2 );
}
}
The code above generates the following result.