I have multiple constructors defined in a class. Is it possible to call a constructor from another constructor’s body?
Answer / Bhuwanesh Garbyal
Yes, it is possible to call another constructor from the current constructor's body using the `this()` keyword. The called constructor must be present in the same class and should have the same access modifier or more accessible than the calling constructor.
| Is This Answer Correct ? | 0 Yes | 0 No |
Does java support multi dimensional arrays ?
Can we declare the main method of our class as private?
What is difference between iterator and enumeration in java?
Can you inherit from an abstract class java?
What are the two types of streams offered by java 8?
What is use of valueof () in java?
Can you give few examples of final classes defined in java api?
What do you mean by exception handling in Java?
What are the different conditional statements?
Is there a case when finally will not execute?
What is nested class?
Is void a keyword in java?