class Employee implements Printable
{
public void print()
{
System.out.println("inside print");
}
public Employee()
{
}
public static void main(
String[] args)
{
Printable p1 =new Employee();
Printable p2 =new Employee();
p1.print();
if(p1.equals(p2))
System.out.println("Equal");
System.out.println("Not Equal");
}
}
how is it possible to call "equals" method on Printable reference??? Because with super class/interface reference we can only call methods of super class/interface .. And "Object" class is not a super class for Printable.
Waiting for a reply...