Object-Oriented Programming (OOPs) Interview Questions
Q1. What is OOP?
OOP is a programming approach based on objects and classes.
Q2. What is a Class and Object?
- Class: Blueprint
- Object: Instance of class
class Student {
int marks = 80;
}
Q3. What is Encapsulation?
Binding data and methods into a single unit.
private int salary;
Q4. What is Inheritance?
One class acquires properties of another class.
class Child extends Parent {}
Q5. What is Polymorphism?
One method behaves differently in different situations.
int add(int a, int b)
double add(double a, double b)

