What is object-oriented programming?
Object-oriented programming organizes software around objects that combine data with the operations that work on that data.
Study 1 Object-Oriented Programming Foundations with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What is object-oriented programming?
Object-oriented programming organizes software around objects that combine data with the operations that work on that data.
What are an object’s three defining aspects?
State is stored information, behavior is provided by methods, and identity gives an object a distinct existence even when its data equals another object’s.
How does OOP differ from procedural programming?
Procedural programming centers on procedures that operate on data; OOP centers on entities that group data with the operations governing it.
What is the difference between a class and an object?
A class is a definition or blueprint for a kind of object. An object is a concrete instance created from that class.
What is the purpose of a constructor?
A constructor establishes the initial valid state of a newly created object, such as validating an initial bank-account balance.
What does encapsulation protect?
Encapsulation bundles state and behavior while controlling access to internal representation, helping preserve invariants through a focused public interface.
What is abstraction in OOP?
Abstraction exposes important concepts and operations while omitting unnecessary implementation details from the caller.
What does inheritance allow a subclass to do?
Inheritance lets a subclass reuse and specialize selected state and behavior from a more general superclass.
What is polymorphism?
Polymorphism lets one general type represent objects with different implementations; the actual object determines the behavior at run time.
What does an interface define?
An interface defines a contract of operations that an implementing class promises to provide, without requiring a shared implementation or class hierarchy.
What is composition in OOP?
Composition builds a class from objects of other classes as parts, expressing a “has-a” relationship such as a car having an engine.
When is inheritance conceptually appropriate?
Inheritance is appropriate when the specialized type genuinely satisfies an “is-a” relationship and can honor the base type’s promises.