class A{
m2(){
}
}
class B extends A{
m2(){
}
}
class c extends B{
m2(){
}
}
class my_class extends c{
m2(){
}
pulic static void main(){
...My_class a = new my_class();
super.super.super.m2(); is this is leagal
if not find what is the legal procedure in order to call A's
version of m2();
}
Answer Posted / santosh subrahmanya
This will work......
class A{
public void m2(){
System.out.println("called...");
}
}
class B extends A{
public void m2(){
super.m2();
}
}
class c extends B{
public void m2(){
super.m2();
}
}
class my_class extends c{
public void m2(){
super.m2();
}
public static void main(String[] args){
my_class a = new my_class();
a.m2();
}
}
| Is This Answer Correct ? | 10 Yes | 2 No |
Post New Answer View All Answers
What is gui programming?
Is cout buffered?
When is update method called?
What is the difference between jvm and jre? What is an interface?
What is function declaration?
Difference between Preemptive scheduling vs. Time slicing?
What is the difference between jdk and jre?
What is javac used for?
What does you mean in math?
What is boolean data type in java?
How to sort double array in java?
In multi-threading how can we ensure that a resource isn't used by multiple threads simultaneously?
What is the abstract class?
What are identifiers in java?
What is the epoch date?