Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: What is the 'this()' constructor call in Java?
Answer: The 'this()' constructor call is used to invoke another constructor in the same class. It must be the first statement in the constructor if used.

Example:

class MyClass { MyClass(int x) { this(); /* other constructor code */ } 
MyClass() { /* default constructor code */ } }
Is it helpful? Yes No

Most helpful rated by users:

©2025 WithoutBook