Core OOP concepts including inheritance, polymorphism, and encapsulation from an intro programming course.
39 cards · basic cards · AI-written, checked twice. Edit anything.
- What is a class?
- A blueprint or template for creating objects that defines attributes and methods.
- What is an object?
- An instance of a class; a concrete entity created from a class template.
- What is inheritance?
- A mechanism allowing a class to acquire properties and methods from another class.
- What is a parent class?
- A class whose properties and methods are inherited by other classes.
- What is a child class?
- A class that inherits properties and methods from a parent class.
- What is polymorphism?
- The ability of an object to take on many forms or the ability of a method to behave differently based on its context.
- What is method overriding?
- A child class providing a specific implementation of a method already defined in its parent class.
- What is method overloading?
- Having multiple methods with the same name but different parameters within the same class.
- What is encapsulation?
- The bundling of data (attributes) and methods together with controlled access to the data.
- What is data hiding?
- The practice of keeping internal class details private and exposing only necessary information through public methods.
- What is an access modifier?
- A keyword that specifies the visibility or scope of a class member (method or attribute).
- What does public access mean?
- A member can be accessed from anywhere, inside and outside the class.
- What does private access mean?
- A member can only be accessed within the class it is defined.
- What does protected access mean?
- A member can be accessed within the class and by its subclasses.
- What is a getter?
- A method that allows read-only access to the value of a private attribute.