December 2001
Intermediate to advanced
520 pages
13h 42m
English
To use OOP, you must begin by defining a class. Classes consist of variables and functions, which are also referred to as attributes (or properties) and methods, respectively.
A philosophical example of a class would be Human. A Human class would have characteristics (or attributes) of gender, height, weight, birth date, and so forth. The actions (or methods) of a Human could be eating, sleeping, and more. A class, in short, is a generalized description of a thing.
The syntax of a class, in the simplest form, is:
class ClassName {
var $variable_name;
function FunctionName () {
// Function code.
}
}
Notice that within the class you must use the var statement to identify your variables. You may, at this time, give the variables ...
Read now
Unlock full access