What is constructor? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is constructor?

13th Oct 2019, 7:16 PM
Ganesh Ram
Ganesh Ram - avatar
1 Answer
+ 2
A constructor in Java is a special method that is used to initialize objects. The constructor is called when an object of a class is created.it should be name as a class name.
13th Oct 2019, 7:31 PM
Muthu Kumar
Muthu Kumar - avatar