DEV Community

Arun Kumar
Arun Kumar

Posted on

Constructor and constructor in java

A constructor is a special method of objects oriented programming that is automatically called when is object of class is created . Its praimary use is allocated memory for new object

  • in java as constructor a special method that is use to Initialize objects

  • the constructor name must be a same name of class name

  • And this is a non return type (like a void)

  • Constructors can also take parameters, which is used to initialize values.

Top comments (0)