diff --git a/language/oop.xml b/language/oop.xml index b018e35831..2bfb9cbe9a 100644 --- a/language/oop.xml +++ b/language/oop.xml @@ -1,5 +1,5 @@ - + Classes and Objects @@ -255,6 +255,25 @@ $ncart->add_item("10", 1); // (inherited functionality from cart) + + This is also called a "parent-child" relationship. You create a class, + parent, and use extends to create a new class + based on the parent class: the child class. You can + even use this new child class and create another class based on this child + class. + + + + Classes must be defined before they are used! If you want the class + Named_Cart to extend the class + Cart, you will have to define the class + Cart first. If you want to create another class called + Yellow_named_cart based on the class + Named_Cart you have to define + Named_Cart first. To make it short: the order in which + the classes are defined is important. + +