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 / sree
class A{
void m2(){
System.out.println("in class A"); }
}
class B extends A{
void m2(){
super.m2();
System.out.println("in class B");
}
}
class c extends B{
void m2(){super.m2();
System.out.println("in class c");
}
}
class Check extends c{
void m2(){
super.m2();
System.out.println("in check()"); }
public static void main(String[] args){
c obj =new Check();
obj.m2();
}
}
Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
Is main an identifier?
How many times finalize method will be invoked? Who invokes finalize() method in java?
Is 0 a prime number?
What is the difference between compare and compareto in java?
What is pangram in java?
What happens if main method is not static?
Describe string intern() methodology
why not override thread to make a runnable? : Java thread
How do you end a program?
is there a separate stack for each thread in java? : Java thread
What is the major drawback of internal iteration over external iteration?
What is instance synchronization?
Can java list be null?
What is a qms manual?
What is function overriding and overloading in java?