Welcome Guest | Sign in | Register
Inheritance - Discussion Page For Q.2862 | Java Programming Questions and Answers | Java Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Inheritance > Questions and Answers

Q: abstract class G{
void test(){
System.out.println(“A”);
}
}
final class Manager extends G{
Void test()
{
System.out.println(“manager”);
}
public static void main(String args[]){
Manager m=new Manager();
m.test();
}
}
A. compile time error B. runtime error
C. manager D. A

Answer and Explanation

Answer:manager

Explanation:
here child class is final that is not a problem, normal flow of execution will give ans as manager

Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved 2012-2015 SoftLucent.