Week 1-OOP Flashcards
(16 cards)
What is Object Oriented Programming (OOP)?
A fundamental concept in Python for building modular, maintainable, and scalable applications.
What are the core OOP principles?
Classes, objects, inheritance, encapsulation, polymorphism, and abstraction.
What does a class represent in OOP?
A user-defined prototype for an object that defines a set of attributes.
What is an object in OOP?
An instance of a certain class.
What is encapsulation?
The practice of hiding implementation details and allowing access to essential features.
How is encapsulation achieved in Python?
Through the use of access modifiers (public, protected, private).
What is inheritance in OOP?
Allows a child class to acquire properties and methods of a parent class.
What is the syntax for defining a child class in Python?
class ChildClass(ParentClass):
What is polymorphism?
Allows methods to have the same name but behave differently based on context.
What is compile-time polymorphism?
Determined during compilation; allows methods or operators with the same name to behave differently.
What is run-time polymorphism?
Determined during execution; occurs when a subclass provides a specific implementation of a method.
What is abstraction in OOP?
Hides internal implementation details while exposing only necessary functionality.
What is partial abstraction?
An abstract class that contains both abstract and concrete methods.
What is full abstraction?
An abstract class that contains only abstract methods (like interfaces).
Fill in the blank: An object has attributes that are _______ and can perform actions using methods.
[specific data]
True or False: Inheritance promotes code reuse.
True