Back to photostream

Constructor in Java

A constructor is a method used to initialize the object.It is automatically called when a class is instantiated.A constructor must have the same name as of class name.

Constructors do not have any return type.It can't be final, static, abstract, or synchronized.

4 views
0 faves
0 comments
Uploaded on December 24, 2023