Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is meant by inheritance and what are its advantages?

1109


Explain an algorithm to find depth of a binary tree.

1046


Is it necessary that each try block must be followed by a catch block?

1024


Is nullpointerexception checked or unchecked?

1041


Does unicode support all languages?

1039


What is java command?

1092


Can we have try without catch block?

1084


what r advatages of websphere? & how to deploy?

2199


What is the static method?

1084


What is an array length?

910


Why java is considered dynamic?

1179


What does the ‘static’ keyword mean? Is it possible to override private or static method in java?

992


What type of language is java?

1007


What is parseint?

1025


What is jar?

1128