-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path0.1Definitions.txt
47 lines (27 loc) · 1.24 KB
/
0.1Definitions.txt
1
2
3
4
5
6
7
8
9
10
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
36
37
38
39
40
41
42
43
Inheritance
----------
Inheritance is the process by which one class takes on the attributes
and methods of another. Newly formed classes are called child classes, and the classes
that child classes are derived from are called parent classes.
Child classes inherit all of the parent's attributes and methods but can also
extend and overrites attributes and methods that are unique id to themselves.
Polymorphism
----------
"Many Shapes"
We can write a code that works on the superclass, and it will work with
any subclass type as well.
Gives a way to use a class exactly like its parent, but each child class
keeps its own methods as they are.
Encapsulation
----------
Encapsulation is the mechanism of hiding of data implementation.
Instance variables are kept private and accessor methods are made public
to achieve this. With this, we restrict access to public methods (getter/setter).
Instance methods can also be kept private
Abstraction
----------
Abstraction can be thought of as a natural extension of encapsulation.
Applying abstraction means that each object should only expose a high-level mechanism
for using it.
This mechanism should hide internal implementation details.
It should only reveal operations relevant for the other objects.