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

Explain when noclassdeffounderror will be raised ?

990


How do you convert bytes to character in java?

946


What is the properties class in java programming?

945


What are the drawbacks for singleton class?

945


How to reverse string in java?

1136


What is the use of jtable?

1063


What is OOP's Terms with explanation?

1125


Can a top level class be private or protected?

1000


What is difference between word and integer?

1007


Explain tree set and its features?

1004


Is nan false?

916


What is the use of string and stringbuffer?

938


Which list is sorted in java?

967


What do you mean by singleton class in java?

856


What methodology can be utilized to link to a database?

902