Why results are different

Report a typo

Given two snippets of code with the Boolean class.


Boolean true1 = true;
Boolean true2 = true;
System.out.println(true1 == true2); // true

Boolean true1 = new Boolean(true);
Boolean true2 = new Boolean(true);
System.out.println(true1 == true2); // false

Why results are different?
Select one option from the list
___

Create a free account to access the full topic