📄 shapetestwithpolymorphism.java
字号:
public class ShapeTestWithPolymorphism
{
public static void main(String args[])
{
Shape shapes[] =
{
new Rectangle(2, 4), new Circle(3),
new Square(4), new RightTriangle(3, 4)};
for (int i = 0; i < shapes.length; i++)
{
shapes[i].computeArea();
shapes[i].computePerimeter();
System.out.println(shapes[i]);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -