Single Choice Not Set

QWhat 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();
        }
}

ID: #2100 Declaration and Access Control in Java 1,031 views
Question Info
#2100Q ID
Not SetDifficulty
Declaration and Access Control in JavaTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A BaseDerived
  • B Derived
  • C Exception is thrown at runtime
  • D Compilation Error
Correct Answer

Explanation

Compilation Error

Share This Question

Challenge a friend or share with your study group.

Related MCQ Questions