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 keyword auto for?

1257


Why runnable interface is used in java?

1198


Which language is java?

1029


What is role of void keyword in declaring functions?

1097


What is a void method java?

1008


How java uses the string and stringbuffer classes?

1135


What is ellipsis in java?

1138


What is null data type?

1187


What is a boolean expression in java?

1077


What is the preferred size of a component in java programming?

1049


What is the difference between numeric and integer?

1060


Is ruby built on java?

990


I want to control database connections in my program and want that only one thread should be able to make database connection at a time. How can I implement this logic?

1147


Explain tree set and its features?

1116


What is anti pattern in java?

1034