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
Explain when noclassdeffounderror will be raised ?
How do you convert bytes to character in java?
What is the properties class in java programming?
What are the drawbacks for singleton class?
How to reverse string in java?
What is the use of jtable?
What is OOP's Terms with explanation?
Can a top level class be private or protected?
What is difference between word and integer?
Explain tree set and its features?
Is nan false?
What is the use of string and stringbuffer?
Which list is sorted in java?
What do you mean by singleton class in java?
What methodology can be utilized to link to a database?