Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: Explain the 'super()' statement in a constructor.
Answer: The 'super()' statement is used to invoke the constructor of the superclass. It must be the first statement in the subclass constructor if used.

Example:

class SubClass extends SuperClass { SubClass() { super(); /* other constructor code */ } }
Is it helpful? Yes No

Most helpful rated by users:

©2025 WithoutBook