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
How do you implement singleton class?
When super keyword is used?
Differentiate between run time error and syntax error.
What is variable explain with example?
What is the difference between class & structure?
What is difference between null and void?
What is this keyword used for?
Which container method is used to cause a container to be laid out and redisplayed in java programming?
Is a boolean 1 bit?
What is casting in java programming?
Why java applets are more useful for intranets as compared to internet?
What is the use of beaninfo?
Can we create an object of private class?
What is the difference between the jdk 1.02 event model and the event-delegation model introduced with jdk 1.1?
What is the purpose of lambda expressions?