I have multiple constructors defined in a class. Is it possible to call a constructor from another constructor’s body?



I have multiple constructors defined in a class. Is it possible to call a constructor from another c..

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

Post New Answer

More Core Java Interview Questions

Does java support multi dimensional arrays ?

6 Answers  


Can we declare the main method of our class as private?

1 Answers  


What is difference between iterator and enumeration in java?

1 Answers  


Can you inherit from an abstract class java?

1 Answers  


What are the two types of streams offered by java 8?

1 Answers  


What is use of valueof () in java?

1 Answers  


Can you give few examples of final classes defined in java api?

1 Answers  


What do you mean by exception handling in Java?

1 Answers   Atos Origin,


What are the different conditional statements?

1 Answers  


Is there a case when finally will not execute?

1 Answers  


What is nested class?

1 Answers  


Is void a keyword in java?

1 Answers  


Categories