資源簡介
Java 提高產品質量的方法(基礎篇-實例101).zip
代碼片段和文件信息
package?com.mingrisoft.oop;
public?class?Box?{
????private?double?length;
????private?double?width;
????private?double?height;
????
????public?double?getLength()?{
????????return?length;
????}
????
????public?void?setLength(double?length)?{
????????if?(length?<=?0)?{
????????????this.length?=?1;
????????}?else?{
????????????this.length?=?length;
????????}
????}
????
????public?double?getWidth()?{
????????return?width;
????}
????
????public?void?setWidth(double?width)?{
????????if?(width?<=?0)?{
????????????this.width?=?1;
????????}?else?{
????????????this.width?=?width;
????????}
????}
????
????public?double?getHeight()?{
????????return?height;
????}
????
????public?void?setHeight(double?height)?{
????????if?(height?<=?0)?{
????????????this.height?=?1;
????????}?else?{
????????????this.height?=?height;
????????}
????}
????
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????232??2010-09-11?17:02??.classpath
?????文件?????????379??2010-09-11?17:02??.project
?????文件?????????974??2013-11-21?08:41??bin\com\mingrisoft\oop\Box.class
?????文件????????1239??2013-11-21?08:41??bin\com\mingrisoft\oop\Test.class
?????文件?????????882??2010-09-11?17:02??src\com\mingrisoft\oop\Box.java
?????文件?????????574??2010-09-11?17:02??src\com\mingrisoft\oop\Test.java
- 上一篇:Java 啟動默認文本工具
- 下一篇:Java 終止循環體
評論
共有 條評論