Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
0
Constructors in java are used to initialize an object and there is no other way to intialize an object. If you don't write a constructor, java will write one for you: [name of class]() {} This is the default constructor. If the name of the class is "Example", java will write: Example() {}
21st Jul 2019, 6:32 PM
troyan
troyan - avatar