作者在 2010-04-06 21:03:00 发布以下内容
package javaBean;
/**
* 长方体类
*/
public class Box {
double length;//长
double width;//宽
double height;//高
public Box()
{//构造函数
length=0;
width=0;
height=0;
}
public void setLength(double length)
{//设置长
this.length=length;
}
public double getLength()
{//得到长
return length;
}
public void setWidth(double width)
{//设置宽
this.width=width;
}
public double getWidth()
{//得到宽
return width;
}
public void setHeight(double height)
{//设置高
this.height=height;
}
public double getHeight()
{//得到高
return height;
}
public double volumn()
{//求容积
double volumnValue;
volumnValue=length*width*height;
return volumnValue;
}
public double surfaceArea()
{//求表面积
double surfaceAreaValue;
surfaceAreaValue=length*width*2+width*height*2+height*length*2;
return surfaceAreaValue;
}
}
package javaBean;/**
* 长方体类
*/
public class Box {
double length;//长
double width;//宽
double height;//高
public Box()
{//构造函数
length=0;
width=0;
height=0;
}
public void setLength(double length)
{//设置长
this.length=length;
}
public double getLength()
{//得到长
return length;
}
public void setWidth(double width)
{//设置宽
this.width=width;
}
public double getWidth()
{//得到宽
return width;
}
public void setHeight(double height)
{//设置高
this.height=height;
}
public double getHeight()
{//得到高
return height;
}
public double volumn()
{//求容积
double volumnValue;
volumnValue=length*width*height;
return volumnValue;
}
public double surfaceArea()
{//求表面积
double surfaceAreaValue;
surfaceAreaValue=length*width*2+width*height*2+height*length*2;
return surfaceAreaValue;
}
}
/**
* 长方体类
*/
public class Box {
double length;//长
double width;//宽
double height;//高
public Box()
{//构造函数
length=0;
width=0;
height=0;
}
public void setLength(double length)
{//设置长
this.length=length;
}
public double getLength()
{//得到长
return length;
}
public void setWidth(double width)
{//设置宽
this.width=width;
}
public double getWidth()
{//得到宽
return width;
}
public void setHeight(double height)
{//设置高
this.height=height;
}
public double getHeight()
{//得到高
return height;
}
public double volumn()
{//求容积
double volumnValue;
volumnValue=length*width*height;
return volumnValue;
}
public double surfaceArea()
{//求表面积
double surfaceAreaValue;
surfaceAreaValue=length*width*2+width*height*2+height*length*2;
return surfaceAreaValue;
}
}