InterviewSolution
Saved Bookmarks
| 1. |
Which among the following function can be used to call default constructor implicitly in java?(a) this()(b) that()(c) super()(d) sub()The question was posed to me in an interview for job.My question comes from Overloading Constructors in portion Constructors and Destructors of Object Oriented Programming |
|
Answer» RIGHT answer is (a) this() Explanation: The function this() can be used to call the default CONSTRUCTOR from inside any other constructor. This helps to further REUSE the CODE and not to WRITE the redundant data in all the constructors. |
|