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
What is linked hashset and its features?
What is loop in java?
Explain scope or life time of local variables in java?
How can you avoid serialization in child class if the base class is implementing the serializable interface?
what is ststic with example
What are benefits of java?
Can we have multiple catch block for a try block?
What is a method in java?
What is the main functionality of the remote reference layer?
What is style and indentation?
What is size_t?
What is method in java ?
How to disable caching on back button of the browser?
In how many ways we can create threads in java?
What are the types of sockets in java?