Tuesday, December 13, 2011

Constructor

  • Constructor is a special method called by the run time for every object while instantiating the object.
  • Objects cannot be created with out Constructor.
  • If a class does not have any constructor, then a java compiler will add parameter less constructor to the class. This constructor is called default constructor.
  • If the parameterised constructor is added to a class, then a compiler will not add default constructor to the class.

No comments:

Post a Comment