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
What is meant by inheritance and what are its advantages?
Explain an algorithm to find depth of a binary tree.
Is it necessary that each try block must be followed by a catch block?
Is nullpointerexception checked or unchecked?
Does unicode support all languages?
What is java command?
Can we have try without catch block?
what r advatages of websphere? & how to deploy?
What is the static method?
What is an array length?
Why java is considered dynamic?
What does the ‘static’ keyword mean? Is it possible to override private or static method in java?
What type of language is java?
What is parseint?
What is jar?