



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




WHAT'S INSIDE
Subtitle: For Placements & Technical Interviews (B.Tech / MCA / CS / IT Students)
What is OOPS? Class & Object Four Pillars of OOPS Encapsulation Abstraction Inheritance Polymorphism Constructor & Destructor Interface vs Abstract Class OOPS Interview Tips
Q1. What is Object Oriented Programming?
Object Oriented Programming (OOPS) is a programming paradigm based on the concept of objects , which contain data and methods.
Advantages:
Code reusability Better security Easy maintenance
Real-world modeling
Q2. What are the main features of OOPS?
Encapsulation Abstraction Inheritance Polymorphism
Class And Object
Q3. What is a Class?
A class is a blueprint or template used to create objects.
Example: A class defines properties and behavior but does not occupy memory.
Q4. What is an Object?
An object is an instance of a class.
Key Points:
Objects represent real-world entities Memory is allocated only when an object is created
Q5. Difference between Class and Object.
Class Object
Blueprint Instance
No memory Memory allocated
Logical entity Physical entity
Encapsulation
INHERITANCE
Inheritance allows a class to acquire properties and methods of another class.
Types of Inheritance:
Single Multilevel Hierarchical Multiple (via interfaces)
Q11. Advantages of Inheritance
Code reusability Reduced redundancy Easy maintenance
POLYMORPHISM
Polymorphism means many forms.
Types:
Q13. Method Overloading vs Method Overriding.
Method overloading Method overriding
same method name same method signature
Different parameters same parameters
Compile time Runtime
Constructor & Destructor
Q14. What is a Constructor?
A constructor is a special method used to initialize objects.
Characteristics:
Same name as class No return type Automatically called
Q15. Types of Constructors
Default constructor Parameterized constructor
Q16. What is a Destructor?
A destructor is used to free memory when an object is destroyed. (Automatically handled in Java, manually in C++)
Interface VS Abstract class
Q17. Abstract Class
Can have abstract and non-abstract methods Supports constructors Supports access modifiers
Q18. Interface
Only abstract methods (Java < 8) No constructors Supports multiple inheritance