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

Home > Java Programming > Inheritance > Questions and Answers

Q: final abstract class G{
void test(){
System.out.println(“A”);
}
}
Public 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:compile time error

Explanation:
when ever you declare class as final you cannot extend that class, in the example above the class G can have either abstract or final but not both. 

Comment on this Question

Name:

Loading...




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