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 / kalpit
super.super.super.m2(); is illegal there can be only super.m2();
There is no way that A's m2 & B's m2 can be called using
object of my_class.
A obj =new A();
obj.m2();
is correct
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Why pass by reference is not possible in java?
Does isempty check for null?
What is the difference between preparedstatement and statement in java?
What is a layout manager and what are different types of layout managers available in java awt?
Which variables are stored in heap?
What is integer valueof?
What are the 4 types of research methods?
How do you input a string in java?
What is the advantage of functional interface in java 8?
What is java Applet?
What is the return type of the main method?
What is meant by memory leak?
Can a method be overloaded based on different return type but same argument type?
Which is the best approach for creating thread ?
Define Multiprogramming and Multiprocessing in java.