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 split string with in java?
Does list allow duplicates in java?
I want to re-reach and use an object once it has been garbage collected. How it's possible?
What is diamond operator in java?
What is the use of coding?
Which is the best sorting technique in java?
Is empty set an element of empty set?
Can a class have multiple superclasses?
What is the benefit of inner classes in java?
What is string variable?
What is a singleton puppy?
Can you declare an interface method static?
What is an 8 bit word?
What is procedure overloading?
Can we define private and protected modifiers for the members in interfaces?