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 / debapriya maity

First super keyword cannot be used from a stati
ccontext,this is the first thing to be remembered.The
correct procedure is

class A{
m2(){
super();
}
}
class B extends A{
m2(){
super();
}
}
class c extends B{
m2(){
super();
}
}
class my_class extends c{
m2(){
super();
}
pulic static void main(){
my_class a = new my_class();
a.m2():
}

}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you implement singleton class?

524


When super keyword is used?

603


Differentiate between run time error and syntax error.

577


What is variable explain with example?

580


What is the difference between class & structure?

577






What is difference between null and void?

543


What is this keyword used for?

699


Which container method is used to cause a container to be laid out and redisplayed in java programming?

614


Is a boolean 1 bit?

623


What is casting in java programming?

590


Why java applets are more useful for intranets as compared to internet?

587


What is the use of beaninfo?

593


Can we create an object of private class?

558


What is the difference between the jdk 1.02 event model and the event-delegation model introduced with jdk 1.1?

623


What is the purpose of lambda expressions?

593