Object Oriented Programming (OOP) Flashcards
1
Q
What is a class in OOP?
A
A blueprint for creating objects.
2
Q
What is an object in OOP?
A
An instance of a class.
3
Q
What is encapsulation?
A
Hiding the internal details of an object and only exposing necessary parts.
4
Q
What is inheritance?
A
When a class derives properties and methods from another class.
5
Q
What is polymorphism?
A
When a method behaves differently based on the object calling it.
6
Q
What is the difference between a class and an object?
A
A class is a blueprint, and an object is an instance of that blueprint.