Constructor in java

  • Constructor is a method .
  • Constructors are used to initialize the object.
  • Constructors are called when object is created.
  • Constructor name and class name should be the same.
  • Constructors are return a value of its same type.
  • Constructor should not have any return type.

2 comments: