Autobox/unbox a Boolean object in Java
Description
The following code shows how to autobox/unbox a Boolean object.
Example
//from w ww . j a va 2 s . c o m
public class Main {
public static void main(String args[]) {
Boolean b = true;
if (b)
System.out.println("b is true");
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »