what is constructora constructor is used to


What is Constructor?

A constructor is used to initialize a newly created object.

  • It's called just after memory is allocated for the object.
  • It can be used to initialize objects.
  • It isn't mandatory to write a constructor for the class.
  • Name of constructor is same as the class name.
  • Can't be inherited.
  • Constructor is invoked whenever an object of its associated class is created.

 

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: what is constructora constructor is used to
Reference No:- TGS0355103

Expected delivery within 24 Hours