5.6.2 Defining a Class
5.6.2 Defining a Class
We have defined two classes: Person and its child class Friend. In any class we define, we should preferably have a constructor subroutine or method. The constructor method is used to create instance of the class. In our program, both methods have constructor classes. In each case, the constructor method is named make. Many programmers prefer to name the constructor methods new.
