Sail E0 Webinar
Question
What is the result of compiling and running the following code?
class Base{
private Base(){
System.out.print("Base");
}
}
public class test extends Base{
public test(){
System.out.print("Derived");
}
public static void main(String[] args){
new test();
}
}
Options:
A .  BaseDerived
B .  Derived
C .  Exception is thrown at runtime
D .  Compilation Error
Answer: Option D

Submit Your Solution Below and Earn Points !
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

More Questions on This Topic :


Latest Videos

Latest Test Papers