-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOOP_pillars.py
More file actions
21 lines (12 loc) · 1.05 KB
/
Copy pathOOP_pillars.py
File metadata and controls
21 lines (12 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
There are 4 pillars of OOPs :-
# 1. Encapsulation => wrapping up of data and it's relative properties and methods into a single unit.
# 2. Abstraction => Hiding unnecessary details from the user and showing only the necessary details.
# 3. Inheritance => Jaha par hum ek class ki properties ko uski subclass ya children classes ke andar transfer karte hai.
# When we transfer the properties of one class to its subclass or child classes, it is called Inheritance.
# 4. Polymorphism => jiske andar same functions ya same operators ko hum form change karke in multiple ways use karte hai.
# When we use the same functions or the same operators in different forms and in multiple ways, it is called Polymorphism.
Access Modifiers :-
Attributes
# 1. Public => accessible in inside the class as well as outside the class by every function everywhere in the code.
# 2. Protected => accessible in inside the class + subsclass (Inheritance) by every function
# 3. Private => accessible only in inside the class not outside the class by every function.