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

Home > Java Programming > Inheritance > Questions and Answers

Q: What will be the result of compiling the following code:

public class SuperClass {
public int doIt(String str, Integer... data)throws Exception{
String signature = "(String, Integer[])";
System.out.println(str + " " + signature);
return 1;
}
}
public class SubClass extends SuperClass{
public int doIt(String str, Integer... data)
{
String signature = "(String, Integer[])";
System.out.println("Overridden: " + str + " " +
signature);
return 0;
}
public static void main(String... args)
{
SuperClass sb = new SubClass();
sb.doIt("hello", 3);
}
}
A. Overridden: hello (String, Integer[]) B. hello (String, Integer[])
C. Complilation fails D. None of the above

Answer and Explanation

Answer:Complilation fails

Explanation:
Unhandled exception type Exception.

Comment on this Question

Name:

Loading...




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