Practice Flashcards
Flip to reveal answersWhat is abstraction?
Track your progress — Sign up free to save your progress and get smart review reminders based on spaced repetition.
All 5 Flashcards — Abstraction
Sign up free to track progress and get spaced-repetition review schedules.
Question
What is abstraction?
Answer
Exposing only the operations a caller needs and **hiding how they are done**.
Question
Abstraction or encapsulation?
Answer
**Abstraction** decides *what* is exposed (design). **Encapsulation** enforces *how* it is protected (access control).
Question
Why can an abstract class not be instantiated?
Answer
Its abstract methods have **no bodies**, so an object of it could be asked to run a method that does not exist.
Question
Abstract class or interface — when do you use each?
Answer
**Abstract class** when children share real behaviour and attributes. **Interface** when unrelated classes must offer the same operations.
Question
What is a leaky abstraction?
Answer
One where the caller must know **how** it works to use it correctly — saveToMySQL() rather than save().
Read the notes
Full study notes for Abstraction
Topic 7.2 hub
OOP: multiple classes
More from Topic 7.2
All flashcards in this topic
Computer Science exam skills
Paper structures & tips
Track your progress with spaced repetition
Sign up free — Aimnova tells you exactly which cards to review and when, so you remember everything before your IB exam.
Start Free