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
How do you escape sequences in java?
What are checked exceptions?
Explain the difference between string, stringbuffer and stringbuilder in java?
What is the difference between actual and formal parameters?
What is the static import?
Can we modify the throws clause of the superclass method while overriding it in the subclass?
What is http client in java?
Why is the main method static?
What is difference between c++ and java ?
Can a final variable be initialized in constructor?
What is class forname?
What do you meant by active and passive objects?
How do you declare an array that will hold more than 64KB of data?
What is byte code and why is it important to java’s use for internet programming?
What is variable and its types?