正 文

利用UML序列图设计Java应用程序详解


www.7dspace.com  更新日期:2005-12-19 5:40:57  七度空间


/*
* Surface.java
*
*/

class Surface {

private String name; // for identification purposes

private double length;

private double width;

public Surface(String initName, double initLength, double initWidth) {

name = initName;

length = initLength;

width = initWidth;

}

public String getName() {

return name;

}

public double getLength() {

return length;

}

public double getWidth() {

return width;

}

public double getArea() {

return width * length;

}

public double getCircumference() {

return 2 * (length + width);

}

}

5页,页码:[1] [2] [3] [4] [5] 

上一篇:用装饰者(Decorator)模式添加功能
下一篇:用递归来优化JavaScript代码
作者:龚赤兵  来源:开发者在线 ( 责任编辑:7dspace )
收藏此页】【打印】【关闭
站 内 搜 索
 

热 点 导 读
特 别 推 荐