The workshop is designed to help you anticipate possible questions, review what you've learned, and begin putting your knowledge into practice.



How would you declare a class called emptyClass that has no methods or properties?


How would you choose a name for a constructor method?



Use the class keyword:

  class emptyClass {   }


You don'ta constructor is named for the class in which it resides.


Create a class called baseCalc() that stores two numbers as properties. Next, create a calculate() method that prints the numbers to the browser. Finally, create classes called addCalc(), subCalc(), mulCalc(), and divCalc() that inherit functionality from baseCalc() but override the calculate() method and print appropriate totals to the browser.

Sams Teach Yourself PHP, MySQL And Apache All in One
Sams Teach Yourself PHP, MySQL and Apache All in One (3rd Edition)
ISBN: 0672328739
EAN: 2147483647
Year: 2004
Pages: 327

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: