Week 8: Initializing Objects with Constructors,Defining member functions outside of the class

  • Constructors are a special kind of methods that are invoked to perform initializing actions.

  • A constructor with no parameters is referred to as a no-arg constructor.

    •Constructors must have the same name as the class itself.

    •Constructors do not have a return type—not even void.

    •Constructors are invoked using the new operator when an object is created. Constructors play the role of initializing objects.