Simple way to understand Encapsulation and Abstraction

后端 未结 15 1136
谎友^
谎友^ 2020-11-27 09:47

Learning OOP concepts especially interested to understand Abstraction and Encapsulation in depth.

Checked out the below already

Abstraction VS Information Hi

15条回答
  •  时光取名叫无心
    2020-11-27 10:43

    Encapsulation: I think this is much to do with how you can bind things into one entity rather than hiding. If you choose to hide something you can.

    Abstraction: Abstraction is much to do with the hiding things and there could be varied levels of abstraction. For example, in functional abstraction we might say that it is important to be able to add items to a list, but the details of how that is accomplished are not of interest and should be hidden. Using data abstraction, we would say that a list is a place where we can store information, but how the list is actually implemented (e.g., as an array or as a series of linked locations) is unimportant and should be hidden.

    Reference

提交回复
热议问题