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
What is the difference between a choice and a list?
What is keyword in oop?
Is a class an object?
What is the purpose of the enableevents() method?
How does multithreading take place on a computer with a single cpu?
What is advantage of java?
Can we have this () and super () together?
Do you need to import math in java?
What are the different http methods?
Is vector ordered in java?
How do you implement polymorphism in our day to day life?
Can array grow dynamically in java?
how we can create packages in java?
What is the purpose of using break in each case of switch statement?
How do you implement singleton class?