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

Home > Java Programming > Inheritance > Questions and Answers

Q: class manager {
private manager(int i) {
System.out.println(1); }
manager(int j){
System.out.println(2); }
public static void main(String args[]){
new manager(1); } }
A. 1 B. 2
C. compile time error D. runtime error

Answer and Explanation

Answer:compile time error

manager(int i) is already defined in manager class, means two constructor with same signature is defined in manager class. So it will throw compile time error.

Comment on this Question



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