Hello Ranchies,
can anybody plz explain me the concept of == operator .
i got confused...for bellow code my answer was false,true,true....
but it is returning true,true,true..... i think valueOf() returns the
instance of invoking wrapper type...
plz help me?...
public class Test5{
public static void main(
String[] args){
Boolean b1 = Boolean.valueOf(true);
Boolean b2 = Boolean.valueOf(true);
Boolean b3 = Boolean.valueOf("TrUe");
Boolean b4 = Boolean.valueOf("tRuE");
System.out.print((b1==b2) + ",");
System.out.print((b1.booleanValue()==b2.booleanValue()) + ",");
System.out.println(b3.equals(b4));
}
}
Regards
Hrushi
