Is this a good example for the difference between abstraction and encapsulation in C++? If not, can you tweak my example in better terms?

Example:

Consider a TV. Encapsulation is the internal circuits, LEDS, etc that combine to make it a TV. Abstraction is the on-off, sound, channel setting and other buttons provided to operate it.

1 Answer

Relevance
  • 4 weeks ago
    Favorite Answer

    That sounds pretty good. You may also explain why these are applicable examples (but it would be fine without this).

    For example,

    "Encapsulation is seen in the grouping/delegation of functionality into elements like [...]."

    "Abstraction allows for high-level interfaces via [...], which translate human-level instructions to low-level signals the hardware can understand."

Still have questions? Get your answers by asking now.