ProAnswers.org

What is the difference between a constructor and a method ?

A constructor is used to initialize the instance variables of a class. A method is used for any general purpose processing or calculations. A constructor’s name and class name should be same. A method’s name and class name can be same or different. A constructor is called at the time of creating object. A method can be called after creating the object. A constructor is called only once per object. A method can be called several times on the object.