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
Can I use % with real numbers?
What are the two parts of a conditional statement?
Is there any tag in htm to upload and download files?
How do you classify Dialog Box?
How is tree Mirroring implemented?
Explain throw keyword in java?
What is Recursion Function?
What is instance example?
How do you reverse a list?
Define array. Tell me about 2-D array.
Explain runtime exceptions?
What is the difference between an inner class and a sub-class?
What is JFC?
What is variable explain with example?
How does java enable high performance?