0% found this document useful (0 votes)
54 views2 pages

OOP Concepts and Interview Notes

Uploaded by

braju746508
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views2 pages

OOP Concepts and Interview Notes

Uploaded by

braju746508
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

■ OOPS – Short Notes

■ 1. Basics
OOP: Programming paradigm based on objects (real-world entities).
Advantages: Reusability, scalability, security, abstraction, modularity.

■ 2. Main Concepts
1. Class – Blueprint for creating objects.
2. Object – Instance of a class.
3. Encapsulation – Binding data & methods together, hides implementation using access
modifiers.
4. Abstraction – Hiding implementation details, showing only essentials (via abstract
classes, interfaces).
5. Inheritance – Acquiring properties of parent class. Types: Single, Multilevel, Multiple,
Hierarchical, Hybrid.
6. Polymorphism – One thing with many forms.
- Compile-time (Method Overloading)
- Runtime (Method Overriding)

■ 3. Access Specifiers
Public – Accessible everywhere.
Private – Accessible only within class.
Protected – Accessible in class & subclasses.

■ 4. Important OOP Features


Constructor – Special method to initialize objects.
Destructor – Cleans up when object is destroyed.
Static – Shared across all objects.
this/self – Refers to current object.
super – Refers to parent class object.

■ 5. Real-Life Examples
Class: Car
Object: BMW, Audi
Encapsulation: Car speed controlled via accelerator.
Abstraction: Start button hides engine complexity.
Inheritance: ElectricCar inherits from Car.
Polymorphism: drive() behaves differently for manual & automatic cars.

■ 6. Common Interview Questions


- Difference between OOP & POP.
- Method Overloading vs Overriding.
- Abstract Class vs Interface.
- Shallow Copy vs Deep Copy.
- Static vs Dynamic Polymorphism.

You might also like