Integer i = new Integer(1);
Integer i1 = new Integer("1");
System.out.println(i.equals(i1)); // true
System.out.println(i==i1); // false
Why first one is giving true ... as i know that equals() method check if both object are equal or not . so one is
string object & one is integer object . one is on string constant pool & one is on integer constant pool ( i am not sure in this , may be GCH ) ... so how can both equal ...
please help ...
second one is clear ...
thanks a lot .