forked from officialtech/xPython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOOPS
More file actions
74 lines (43 loc) · 3.01 KB
/
OOPS
File metadata and controls
74 lines (43 loc) · 3.01 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
-----------------------------------------------------------------------------------------------------------------
1.OOPS - object oriented programming system
2.OOAD - object oriented analysis & design
3.OOPL - object oriented programming language
-----------------------------------------------------------------------------------------------------------------
Object oriented programming system is a mechanism to write programs using class & object.
OOPS is providing four principles as per object oriented analysis & design (OOAD).
These are:-
Abstraction
Encapsulation
Inheritance
Polymorphism
***************************************************************************************************************
Any programming language which is following four principles is called as OOPL.
***************************************************************************************************************
******************************* Abstraction ******************************************************************
Abstraction is the process of providing necessary data & hiding unnecessary data.
To achieve the abstraction we need to analysis the requirement.
The purpose of abstraction is first level memory management.
********************************** Data **********************************************************************
Data is a collection of raw facts, which has no meaning in real world.
example:- 944
Data 1. Numaric data 1.1 Integer data 1.1.1 Positive integer
1.1.2 Negative integer
1.2 Decimal data 1.2.1 Positive decimal
1.2.2 Negative decimal
2. character data 2.1 Single character
2.2 Multi-character
****************************************** Encapsulation ************************************************************
Encapsulation is a process of binding RELATED state and behaviours into a single container.
State is nothing but VARIABLE.
Behaviour is nothing but METHOD.
Container is nothing but a CLASS.
******************************************** Inheritance **********************************************************
Inheritance is a process of getting properties (STATE & BEHAVIOUR) from a class to another classs.
The class which is providing properties is called SUPER/BASE class.
The class which is accepting/taking properties is called SUB/DERIVED class.
********************************************* Polymorphism *************************************************************
Poly + morph
Poly means 'Many'
morph means 'Behaviour'
Polymorphism is many behaviour under one name.
............ ....