Single Choice Not Set

QSuppose A is an abstract class, B is a concrete subclass of A, and both A and B have a default constructor. Which of the following is correct?

1. A a = new A();
2. A a = new B();
3. B b = new A();
4. B b = new B();

ID: #2274 Java Interfaces And Abstract Classes MCQ 6,950 views
Question Info
#2274Q ID
Not SetDifficulty
Java Interfaces And Abstract Classes MCQTopic

Choose the Best Option

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

  • A 1 and 2 ✔ ✖
  • B 2 and 4 ✔ ✖
  • C 3 and 4 ✔ ✖
  • D 1 and 3 ✔ ✖
Correct Answer

Explanation

2 and 4

Share This Question

Challenge a friend or share with your study group.