Vidyalelo
Java Programming · Q58

Constructors and Methods

Programming · Java Programming · question 58

Q58

class A A(String s) A() class B extends A B() B(String s) super(s); void test() // insert code here Which of the below code can be insert at line 7 to make clean compilation ?

A.
A a = new B();
Answer
B.
A a = new B(5);
C.
A a = new A(String s);
D.
All of the above
E.
None of these

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board