:confused:
Is it possible to compare 2 objects like we do with Strings using equals() method.
for e.g,
class A
{
int a=10,b=10,c=10;
}
class Equals
{
public static void main(String s[])
{
A a,b;
a=new A();
b=new A();
if(a.equals(b))
System.out.println("We r same...");
else
System.out.println("We r not same...");
}
}
this program gives me "We r not same....."
How does equals() work in this program?
if any one can help.....!!!