Once you defined your class, then you can create as many objects as you like of that class type. Following is an example of how to create object using new operator.
$physics = new Books; $maths = new Books; $chemistry = new Books; |
Here we have created three objects and these objects are independent of each other and they will have their existance separately. Next we will see how to access member function and process member variables.
No comments:
Post a Comment