← Object-Oriented Programming learning path
Object-Oriented Programming · Module 4 of 10

Abstraction

Show only essential features and hide complexity.

📖 Key ideas

  1. Abstraction exposes what an object does, not how.
  2. Abstract classes cannot be instantiated and may have abstract methods.
  3. Interfaces define method contracts.
  4. Users of a class rely on its public interface.
  5. Reduces complexity for callers.
💡 Real-life example: Abstraction is driving a car: you use the steering and pedals without knowing engine details.
AbstractionHiding implementation details
Abstract classClass that cannot be instantiated directly
InterfaceContract of methods
Abstract methodMethod without a body