封裝性

<p>書上說,實現類的封裝能夠實現: <br />一、隱藏類的實現細節。 <br />二、讓使用者只能經過事先定製好的方法來訪問數據,能夠方便地加入控制邏輯,限制對屬性的不合理操做。 <br />三、便於修改,加強代碼的可維護性。 <br />四、可進行數據檢查 </p> <p>&#160;</p> <p><a href="http://static.oschina.net/uploads/img/201405/27214244_2Cpz.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://static.oschina.net/uploads/img/201405/27214245_H5y3.png" width="733" height="372" /></a></p> <a href="http://static.oschina.net/uploads/img/201405/27214247_tBXx.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://static.oschina.net/uploads/img/201405/27214248_kK1A.png" width="730" height="346" /></a>.net

相關文章
相關標籤/搜索