Can any one explain the following...
THe answer is...(d)false true true false...
Here b1 &b2 are two different references...
and b3 and b4 refereing to same...thats why b3==b4 returns true...
am I wrong...?
Question 19
This is from -http://www.geekevaluation.com/Exam/question)
public class etattva6 {
public static void main(
String[] args) {
Boolean b1 = new Boolean(true);
Boolean b2 = new Boolean(true);
boolean b3 = true;
Boolean b4 = true;
System.out.println(b1==b2);
System.out.println(b1==b3);
System.out.println(b3 == b4);
System.out.println(b1 == b4);
}
}
What is the output for the above program?
Your Answer
false false true true
true true true true
false false false false
false true true false