posted 17 years ago
I read about hashcode from many books & refernce but atill have confusion.
this i1 & i are 2 different objects but equals() still returns true .
Same thing if do using 2 Objects of same state var ,it shows unequality.
Integer i=new Integer(1);
Integer i1=new Integer(1);
System.out.println("equality "+i.equals(i1));
System.out.println("hashcode "+i.hashCode()+i1.hashCode());
Please explain me how its showing this output.
[ June 26, 2007: Message edited by: Lucky J Verma ]
[ June 26, 2007: Message edited by: Lucky J Verma ]