cylindertest.java
来自「该包中定义了几个类」· Java 代码 · 共 20 行
JAVA
20 行
import p2.Point;
public class CylinderTest
{
public static void main(String agrs[])
{
Cylinder cy1=new Cylinder(2,3,4,5);
Point p=new Point(3,4);
Cylinder cy2=new Cylinder(p,5,6);
Cylinder cy3=new Cylinder();
System.out.println("The volume of the cy1(2,3,4,5) is: "+cy1.volume());
System.out.println("The volume of the cy1(p(3,4),5,6) is: "+cy2.volume());
System.out.println("The volume of the cy3() is: "+cy3.volume());
System.out.println("The surfaceArea of the cy1(2,3,4,5)is : "+cy1.surfaceArea());
System.out.println("The surfaceArea of the cy2(p(3,4),5,6)is :"+cy2.surfaceArea());
System.out.println("The surfaceArea of the cy3()is :"+cy3.surfaceArea());
System.out.println(cy1.toString());
System.out.println(cy1.equals(cy2));
System.out.println(cy1.equals(cy1));
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?