/////////////////////////////////////////////Task 7 A /////////////////////////////////////////
Echo "
Task 7: A
";
Echo " When a modifier is set to private the property is only accessible by the class it's self.
";
Echo " When a modifier is set to protected the property is only accessible by the class it's self and
";
Echo " when the class is extended/inherited the subclass can also access the property.
";
Echo " When a modifier is set to Public the property is accessible from inside and outside the class.
";
/////////////////////////////////////////////Task 7 B /////////////////////////////////////////
Echo "Task 7: B
";
Echo "Setting a Public property value:
";
Echo ' $InstanceOfObject->setProperty($NewValue);
';
Echo "Getting a Public property value:
";
Echo ' $MyLocalVar = $InstanceOfObject->GetProperty();
';
Echo "Using a class constant outside the class it is defined:
";
Echo ' As the constant is not part of an instantiated object but part of the class scope
';
Echo ' you can use the Scope resolution operator as follow:
';
Echo ' $MyLocalVar = ClassName::constName;
';
/////////////////////////////////////////////Task 7 C /////////////////////////////////////////
Echo "Task 7: C
";
Echo " An abstract class has all of the standard benefits of creating a baseclass that classes can inherit.
";
Echo " An abstract class is used mostly as a superclass/baseclass as it can not be used to directly
";
Echo " create an object. By using a concrete subclass that inherits the abstract class you can
";
Echo " now create an object from the concreate class that encapsulated the abstract class.
";
Echo " When you extend a abstract class you must always implement all abstract methods from the abstact class
";
Echo " or else you will get a fatal error.
";