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 return code?
How is hashset defined in java?
Where are the card layouts used?
What is a vector in java?
What is meant by stack and queue?
What is ellipsis in java?
What is dynamic binding(late binding)?
What is boolean law?
What about anonymous inner classes in java?
What are three ways in which a thread can enter the waiting state in java programming?
Which method returns the length of a string?
What is the list interface in java programming?
What are the steps involved to create a bean?
Can a class have 2 constructors?
When arithmeticexception is thrown?