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?
Answer Posted / mayank sharma
no answer will be possible of this question
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Can we use a default constructor of a class even if an explicit constructor is defined?
What Is Composition?
What is pojo class in java?
What is the base class of all classes?
What does ide stand for?
What about main thread in java?
What are the methods to rectify ambiguities in the interfaces in JAVA?
What is an example of a conditional statement?
How does hashset works in java?
Can we have two methods in a class with the same name?
Is string pool garbage collected?
what is the use of pojo (plain old java objects)? how it is interact with crystal reports? pls urgent
Give the hierarchy of inputstream and outputstream classes.
What is the indent key?
Why there are some null interface in java? What does it mean?