3.3 DECLARING A CLASS
You might have noticed from the previous example that declaring a class (an
object template) is simple. You use the class keyword, give the class a name,
and list all the methods and properties an instance of this class should have:
class MyClass {
… // List of methods
…
… // List of properties
…
}
You may have noticed that, in front of the declaration of the $name prop-
erty, we used the private keyword. We explain this keyword in detail later, but
it basically means that only methods in this class can access $name. It forces
anyone wanting to get/set this property to use the getName() and setName()
methods, which represent the class’s interface for use by other objects or
source code.
-
‹ Home
-
Categories
- .Net
- Ajax
- Basic of Computers
- Basic of MySQL
- C For Beginners
- C Programming
- C# Professional in 15 days - (Book)
- CSS
- CSS Advanced
- CSS For Beginners
- Free Computer Books Online
- HTML For Advanced
- HTML for Beginners
- HTML Tips and Tricks
- INDEX
- Introduction to JavaScript
- Java 2 (simpler way-Old version)
- Javascript
- Javascript For Beginners
- Javascript Tutorial for Beginners
- jQuery
- Linux/Unix
- miscellaneous tricks
- Mozilla firefox tricks
- MS word tricks
- MySQL Basic
- Mysql Classes
- Mysql Functions
- News and Alerts
- Notepad tricks
- PHP
- PHP 5 Power Programming
- PHP Ad Management
- PHP and MySQL - From Beginning to Professional
- PHP and XML
- PHP Script
- PHP Tricks
- Professional C sharp
- Tips and tricks
- Windows tricks
- Wordpress
- Wordpress Plugins
-
Tags
acrobat adobe amazon apple basic of computer CSS css3 current news David Hill delete dell escape google Hack HP IBM IE interesting news internet IT Javascript keyboard knowledge laptop lenovo miscellaneos tricks mouse event mozilla firefox Netezza Corp news News and Alerts onmouseout onmouseover opera oracle PC pdf Robin Johnson safari shortcuts sun microsystems Teradata Corp Tips and tricks windows yahoo
-
Archives
-
RSS Feeds
-
Account
Post a Comment