Question discussion

Suppose 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 corre…

281221Medium 1 reply 3,768 views
38
Suppose 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();
  • A1 and 2
  • B2 and 4
  • C3 and 4
  • D1 and 3
  • E2 and 3
Correct answer: B

Discussion 1

0
CCommunity
2 and 4