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 constructor in java ?

1193


Can a class extends itself in java?

1025


What is an argument java?

973


How we can skip finally block of exception even if some exception occurs in the exception block in java?

948


What means public static?

1038


which one is more efficient int x; 1. if(x==null) 2.if(null==x) state which one either 1 or 2?

11205


How can a gui component handle its own events in java programming?

1044


How use .contains in java?

1174


How to read and write image from a file ?

1044


Is integer immutable in java?

989


What is the use of math abs in java?

1010


What is the use of join method?

1032


What is the purpose class.forname method?

964


What is difference between an object and a class?

1126


What super () does in java?

908