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

Can each java object keep track of all the threads that want to exclusively access it?

952


What is the use of http-tunneling in rmi?

1053


What is dynamic binding(late binding)?

1054


Can vector have duplicates in java?

957


What is thread synchronization in java?

904


What is command line argument

1202


What is bytecode verifier?

949


What is class level lock ?

1039


What is a boolean output?

970


Can we rethrow the same exception from catch handler?

1135


What are default methods ?

1052


What are the four versions of java?

1017


Why is multiple inheritance not supported in java?

1040


Describe the term diamond problem.

1041


2) Suppose there are 5 directories having lot of files (say txt files) in each directory. 2 things :- 2.1) You want to search for filenames which have a particular pattern. 2.2) Out of these filtered files you want to search for a particular keyword or a search string. How can you achieve this?

2285