18 flashcards · Shared on 19 August 2026 by AtomAI Library
Flip each card to check yourself.
What is a class in object-oriented programming?
A blueprint that defines the data and behavior of objects
What is a class in object-oriented programming?
A blueprint that defines the data and behavior of objects
Which description best defines an object?
An instance of a class with its own state and behavior
In an object, what does its state usually consist of?
The values held in its fields or attributes
Encapsulation is the practice of doing what?
Combining data with related methods and controlling access to internal details
Why are an object's fields often made private?
To control how the object's state is read or changed
What does abstraction provide in object-oriented design?
A simplified interface that hides unnecessary implementation details
What is inheritance?
Allowing a class to acquire or extend features of another class
Which relationship is most directly represented by inheritance?
An is-a relationship
Polymorphism allows code to do what?
Treat objects of different types through a common interface while obtaining type-appropriate behavior
A subclass supplies its own implementation of an inherited method with the same signature. What is this called?
Method overriding
What commonly happens when an overridden method is called through a parent-type reference?
The implementation associated with the actual object is selected
What is the usual purpose of a constructor?
To initialize a newly created object
In object-oriented programming, what is an interface?
A contract specifying operations that implementing types must provide
Which statement best describes an abstract class?
It is intended as a base class and may leave some behavior for subclasses to implement
What is composition in object-oriented design?
Building a class from objects of other classes as components
Why is composition often described as a has-a relationship?
One object contains or uses another object as a component
What is a key benefit of programming to an interface rather than a concrete class?
Implementations can be replaced with less impact on client code
What is the main goal of information hiding?
To limit dependence on implementation details that may change