📘 ADVANCED PROGRAMMING
1️⃣
Object-Oriented Programming (Deep Concept)
Object-Oriented Programming (OOP) is a paradigm based on objects and classes.
Languages that strongly use OOP:
Java
C++
Python
---
🔹 1.1 Class and Object
Class
Blueprint for creating objects.
Object
,Instance of a class.
Example (Python):
class Student:
def __init__(self, name, age):
self.name = name
self.age = age
def display(self):
print(self.name, self.age)
s1 = Student("Samson", 21)
s1.display()
---
🔹 1.2 Encapsulation
Hiding internal data
Access through methods (getters/setters)
Improves security
, 🔹 1.3 Inheritance
Allows one class to inherit properties of another.
Types:
Single inheritance
Multiple inheritance
Multilevel inheritance
Hierarchical inheritance
---
🔹 1.4 Polymorphism
Same function name → different behavior.
Example:
Method overloading
1️⃣
Object-Oriented Programming (Deep Concept)
Object-Oriented Programming (OOP) is a paradigm based on objects and classes.
Languages that strongly use OOP:
Java
C++
Python
---
🔹 1.1 Class and Object
Class
Blueprint for creating objects.
Object
,Instance of a class.
Example (Python):
class Student:
def __init__(self, name, age):
self.name = name
self.age = age
def display(self):
print(self.name, self.age)
s1 = Student("Samson", 21)
s1.display()
---
🔹 1.2 Encapsulation
Hiding internal data
Access through methods (getters/setters)
Improves security
, 🔹 1.3 Inheritance
Allows one class to inherit properties of another.
Types:
Single inheritance
Multiple inheritance
Multilevel inheritance
Hierarchical inheritance
---
🔹 1.4 Polymorphism
Same function name → different behavior.
Example:
Method overloading