class RectangleDemo
{
public double countArea(double length,double wide)
{
return length*wide;
}
public double countPerimeter(double length,double wide)
{
return (length+wide)*2;
}
}
class RectangleText
{
public static void main(String[] args)
{
RectangleDemo r = new RectangleDemo();
System.out.println(r.countArea(103.4,123.4));
System.out.println(r.countPerimeter(103.4,123.4));
}//123.4
}
结果为:12759.560000000001
453.6 |
|