package wrapper_boxing;
public class WrapperTest2 {
public static void main(String[] args) {
Boolean bool1 = new Boolean(true);
Boolean bool2 = new Boolean(false);
Boolean bool3 = new Boolean("false");
Boolean bool4 = new Boolean(bool1);
System.out.println(bool1.equals(bool4));
System.out.println(bool2 == bool3);
System.out.println(bool1 == bool4);
}
}
1) The program will not compile because the creation of bool4 object will cause compilation error.
2) The program will produce the output 'true false false'.
3) The program will produce the output 'true true true'.
4) The program will output 'true false true'.
por que 2?