InterviewSolution
Saved Bookmarks
| 1. |
Which among the following is not valid in java?(a) Constructor overloading(b) Recursive constructor call(c) Default value constructors(d) String argument constructorI got this question during a job interview.I'd like to ask this question from Overloading Constructors topic in portion Constructors and Destructors of Object Oriented Programming |
|
Answer» RIGHT CHOICE is (b) Recursive constructor call To EXPLAIN I would say: Java doesn’t provide the feature to recursively call the constructor. This is to ELIMINATE the out of memory error in some cases that arises unexpectedly. That is an predefined CONDITION for constructors in java. |
|