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 / sree

class A{
void m2(){

System.out.println("in class A"); }
}

class B extends A{
void m2(){
super.m2();
System.out.println("in class B");
}
}

class c extends B{
void m2(){super.m2();
System.out.println("in class c");
}
}

class Check extends c{
void m2(){
super.m2();
System.out.println("in check()"); }
public static void main(String[] args){
c obj =new Check();
obj.m2();
}
}

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between a choice and a list?

1131


What is keyword in oop?

1007


Is a class an object?

1076


What is the purpose of the enableevents() method?

1085


How does multithreading take place on a computer with a single cpu?

1059


What is advantage of java?

1070


Can we have this () and super () together?

1100


Do you need to import math in java?

1063


What are the different http methods?

1105


Is vector ordered in java?

1051


How do you implement polymorphism in our day to day life?

3286


Can array grow dynamically in java?

1032


how we can create packages in java?

1017


What is the purpose of using break in each case of switch statement?

1069


How do you implement singleton class?

1038