A brilliant example of effective encapsulation through information hiding?

后端 未结 5 930
旧时难觅i
旧时难觅i 2021-02-04 12:13

\"Abstraction and encapsulation are complementary concepts: abstraction focuses on the observable behavior of an object... encapsulation fo

5条回答
  •  后悔当初
    2021-02-04 12:53

    Nearly every Java, C#, and C++ code base in the world has information hiding: It's as simple as the private: sections of the classes.

    The outside world can't see the private members, so a developer can change them without needing to worry about the rest of the code not compiling.

提交回复
热议问题