+ 1
What's meaning of two objects are same ?? Give some examples..
6 ответов
+ 2
class A {}
A obj = new A();
A obj2 = obj;
System.out.print(obj==obj2);
+ 2
No. You created different objects dynamically using the new keyword.
+ 1
A obj = new A("Amit");
A obj1 = newA("Amit");
are they same object??
+ 1
Integer a= new Integer(10);
Integer b= a;
Integer c= b;
Here a b and c are differents variables that point to same object
+ 1
if they are not same then they should generate different HashCode ..
and if they going to generate different HashCode how we going to compare equality using equals..
+ 1
same objects its different from equals objects