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


Please Help Members By Posting Answers For Below Questions

Why pass by reference is not possible in java?

508


Does isempty check for null?

575


What is the difference between preparedstatement and statement in java?

565


What is a layout manager and what are different types of layout managers available in java awt?

733


Which variables are stored in heap?

549






What is integer valueof?

651


What are the 4 types of research methods?

522


How do you input a string in java?

514


What is the advantage of functional interface in java 8?

535


What is java Applet?

656


What is the return type of the main method?

590


What is meant by memory leak?

546


Can a method be overloaded based on different return type but same argument type?

554


Which is the best approach for creating thread ?

734


Define Multiprogramming and Multiprocessing in java.

588