Which of the following statements in the given code are true?

class A { A(int i) {} }  // 1
class B extends A {}   // 2
The compiler will create a default constructor for the class B, which to create an object will try to call a nonexistent constructor without parameters of class A. As a result, it will generate a compiler error in line 2.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Sign Up Now
or Subscribe for future quizzes