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 / santosh subrahmanya

This will work......

class A{
public void m2(){
System.out.println("called...");
}
}

class B extends A{
public void m2(){
super.m2();

}
}

class c extends B{
public void m2(){
super.m2();

}
}

class my_class extends c{
public void m2(){
super.m2();

}

public static void main(String[] args){

my_class a = new my_class();
a.m2();

}
}

Is This Answer Correct ?    10 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is gui programming?

959


Is cout buffered?

1114


When is update method called?

1092


What is the difference between jvm and jre? What is an interface?

1017


What is function declaration?

916


Difference between Preemptive scheduling vs. Time slicing?

982


What is the difference between jdk and jre?

1007


What is javac used for?

893


What does you mean in math?

1013


What is boolean data type in java?

939


How to sort double array in java?

946


In multi-threading how can we ensure that a resource isn't used by multiple threads simultaneously?

1271


What is the abstract class?

976


What are identifiers in java?

1044


What is the epoch date?

957