Q. What is the result of the following code snippet?

abstract class MyAbstract {
MyAbstract() {
System.out.println("Constructor");
}
}
class MyClass extends MyAbstract {
public static void main(String[] args) {
MyClass obj = new MyClass();
}
}

  • (A) MyClass
  • (B) Runtime exception
  • (C) Constructor
  • (D) Compilation error
πŸ’¬ Discuss
βœ… Correct Answer: (C) Constructor

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
153
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Admin
Publisher
πŸ“ˆ
83%
Success Rate