-2

Encapsulation is just hiding the internal mechanism of the program

Abstraction is providing a public interface from encapsulated program

is that true ??

Adham shafik
  • 1,044
  • 1
  • 13
  • 16

2 Answers2

1

Encapsulation is how you reduce tight coupling between components, by hiding their implementation details while exposing a consistent interface. Encapsulation means you can change how a unit performs its work without affecting the behaviour of all other units that use it.

Abstraction is the more general concept of simplifying or generalizing something. For a better explanation: http://en.wikipedia.org/wiki/Abstraction_(computer_science)

Jeffrey Kemp
  • 59,135
  • 14
  • 106
  • 158