Abstraction vs Encapsulation

Let's say a ceiling fan is running. From the outside, we can only see the rotation of the fan, but we cannot see how the motor works inside or how the various components are connected. This hidden part is "Abstraction", which the user cannot directly see or understand. Now, all the components inside the fan are covered by an outer casing, so they cannot be seen from the outside. This outer layer is "Encapsulation".

Feb 16, 2025 - 07:09
 0
Abstraction vs Encapsulation

Let's say a ceiling fan is running. From the outside, we can only see the rotation of the fan, but we cannot see how the motor works inside or how the various components are connected. This hidden part is "Abstraction", which the user cannot directly see or understand.
Now, all the components inside the fan are covered by an outer casing, so they cannot be seen from the outside. This outer layer is "Encapsulation".