What is the base class of all exception classes?
Can we declare a constructor as final?
What is the meaning of variables in research?
What is a java string?
Inorder to specify a container?s layout, which method is used?
What is meant by Servelet? What are the parameters of service method?
What is the difference between hashset and treeset in java?
What is the best way to findout the time/memory consuming process?
Which class has no duplicate elements?
Can any one say how will sort map objects in java?
What is JVM ?
4 Answers Phantom Technologies, TCS,
Explain the difference between throw and throws in java?
interface X{ void m1(); void m2(); } class Child2 extends Object implements X { public void m1(){ System.out.println("Child2 M1"); } public void m2(){ System.out.println("Child2 M2"); } } public class ParentChildInfterfaceDemo { public static void main(String[] args){ X x = new Child2(); X x1 = new Child2(); x.m1(); x.m2(); x.equals(x1); } } Will the above code work? If yes? Can you please explain why the code x.equals(x1) will work as the equals method is called on interface reference vaiable?