Hi,
can any one please say about Ex in 4,5,6,7.
Basically i am not understanding the object declaration.
OOps, i checked with a program, and Equals indeed checks if both references point to the same object.
//Program
public class ObChk
{
public static void main(
String[] args)
{
Ex e1=new Ex(1,2);
Ex e2=new Ex(1,2);
Ex e3=new Ex(4,5);
Ex e4;
e4=e2;
if (e1.equals(e2))
{
System.out.println("e1 and e2 Equal");
}
if (e1.equals(e3))
{
System.out.println("e1 and e3 Equal");
}
if (e2.equals(e4))
{
System.out.println("e2 and e4 Equal");
}
}
}
The above program outputs only
e2 and e4 are equal.
Nisheeth