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


Please Help Members By Posting Answers For Below Questions

What is linked hashset and its features?

561


What is loop in java?

541


Explain scope or life time of local variables in java?

573


How can you avoid serialization in child class if the base class is implementing the serializable interface?

646


what is ststic with example

1601






What are benefits of java?

571


Can we have multiple catch block for a try block?

598


What is a method in java?

566


What is the main functionality of the remote reference layer?

1428


What is style and indentation?

563


What is size_t?

518


What is method in java ?

633


How to disable caching on back button of the browser?

535


In how many ways we can create threads in java?

643


What are the types of sockets in java?

550