output are: true,true*,false* what is going on case=1 and case=2 if case:1 is true than why? value 5 has different memory allocation? we know that '==' operator compare based on memory or refrence
Integer a=new Integer(5);
Integer b=a;
System.out.println(a==b); //true i know
/*case:1 */System.out.println(a==5); //true? why
/*case :2 */ System.out.println(a==new Integer(5)); // false ? why