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 internal variable?

996


what is enumset?

1099


List out five keywords related to exception handling ?

1000


Can a class have multiple subclasses?

1085


What is java abstraction with example?

1041


What is an infinite loop? How infinite loop is declared?

1087


How many types of classes are there in java?

1036


What is the SimpleTimeZone class?

2250


What is the difference between static binding and dynamic binding?

1095


What is a parameter in matrices?

1032


Explain about anonymous inner classes in java?

1057


How do you declare a variable?

1078


Can you give few examples of final classes defined in java api?

991


What is included in core java?

1044


What is difference between hashset and hashmap?

1102