πŸ“Š JAVA
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

πŸ‘οΈ
108
Total Visits
πŸ“½οΈ
12 mo ago
Published
πŸŽ–οΈ
Admin
Publisher
πŸ“ˆ
96%
Success Rate