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 / kalpit
super.super.super.m2(); is illegal there can be only super.m2();
There is no way that A's m2 & B's m2 can be called using
object of my_class.
A obj =new A();
obj.m2();
is correct
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is the use of parseint in java?
What is a hashmap used for?
Can you sort a list in java?
What is return keyword in java?
What are meta-annotations?
What is the differences between heap and stack memory in java? Explain
Where local and global variables are stored?
Why is sizeof not a function?
What is :: operator in java 8?
What are different types of constants?
How would you convert bytes to string?
What is string immutability?
What will be the default values of all the elements of an array defined as an instance variable?
What an i/o filter?
How can we achieve thread safety in java?