Java面向对象习题
1 .编写一个Shape接口, 具有一个draw 方法, 并编写三个类Triangle,Rectangle,Diamond都实现Shape 接口。 在3个类中分别实现draw方法打印如下星阵: * **** * *** **** *** ***** **** * 编写一个测试类具有一个测试方法, 使用Shape 参数, 方法体中调用Shape的draw 方法,打印出斜体样式相应图形*
public class h1 {
public static void main(String[] args)
原创
2020-07-16 20:53:01 ·
584 阅读 ·
0 评论