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
Can each java object keep track of all the threads that want to exclusively access it?
What is the use of http-tunneling in rmi?
What is dynamic binding(late binding)?
Can vector have duplicates in java?
What is thread synchronization in java?
What is command line argument
What is bytecode verifier?
What is class level lock ?
What is a boolean output?
Can we rethrow the same exception from catch handler?
What are default methods ?
What are the four versions of java?
Why is multiple inheritance not supported in java?
Describe the term diamond problem.
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?