private doesn't mean the information cannot be access.



所有跟贴·加跟贴·新语丝读书论坛http://www.xys.org/cgi-bin/mainpage.pl

送交者: steven 于 2005-1-30, 04:10:38:

回答: 那GET又有什么意义? 由 HunHunSheng 于 2005-1-29, 18:51:34:

Private means hiding the detail implementation of data. For a simple program, which means to teach a kid about OOP, getDiameter() may not mean anything but reduendent. For any serious programing, that circle may very well locate in another address space, i.e. a different program running on another computer. Then you will appreciate the advantage of get and set methods.



所有跟贴:


加跟贴

笔名: 密码(可选项): 注册笔名请按这里

标题:

内容(可选项):

URL(可选项):
URL标题(可选项):
图像(可选项):


所有跟贴·加跟贴·新语丝读书论坛http://www.xys.org/cgi-bin/mainpage.pl