送交者: 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.