ch6/ch6-06 #163
Replies: 6 comments 2 replies
-
这翻译的,真的是机翻,为绕而绕 |
Beta Was this translation helpful? Give feedback.
-
没有理解这篇的精神 |
Beta Was this translation helpful? Give feedback.
-
这一节原文就写的这么烂,不知道为什么要写的这么复杂 |
Beta Was this translation helpful? Give feedback.
-
其实感觉有些篇并没有编好,看进去要花时间,结果还发现一点用没有 |
Beta Was this translation helpful? Give feedback.
-
“换句话说,相对于*s这个表达式会出现在所有的包中,s.words只需要在定义IntSet的包中出现(译注:所以还是推荐后者吧的意思)” |
Beta Was this translation helpful? Give feedback.
-
6.6 封装封装是指对象的某些变量或方法对外部不可见,通常也称为信息隐藏。封装是面向对象编程的一个关键方面。 封装的实现
封装的优点
Getter和Setter
封装的实例
总结封装在面向对象编程中非常重要,它不仅简化了代码,还隐藏了实现细节,保证了数据的一致性。在Go中,封装通过大写和小写字母来控制可见性。封装和方法是OOP编程的基础,下一章将介绍接口,进一步完善OOP编程。 |
Beta Was this translation helpful? Give feedback.
-
ch6/ch6-06
中文版
https://gopl-zh.github.io/ch6/ch6-06.html
Beta Was this translation helpful? Give feedback.
All reactions