In essence, a property is a variable which is declared inside the class itself,
but not inside any function in that class.
Method: Methods are functions inside a class. Like properties, methods can also be
accessible by those three types of users.
Encapsulation: Encapsulation is the mechanism that binds together code and the
data it manipulates, and keeps both safe from outside interference and misuse.
The wrapping up of data and methods into a single unit (called class) is known as
encapsulation. The benefit of encapsulating is that it performs the task inside without
. making you worry.
Chapter 1
[ 17 ]
Polymorphism: Objects could be of any type. A discrete object can have discrete
properties and methods which work separately to other objects. However a set
of objects could be derived from a parent object and retain some properties of the
parent class. This process is called polymorphism. An object could be morphed into
several other objects retaining some of its behaviour.
Inheritance: The key process of deriving a new object by extending another object
is called inheritance. When you inherit an object from another object, the subclass
(which inherits) derives all the properties and methods of the superclass (which is
inherited).
Pages:
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35