- 博客(3)
- 收藏
- 关注
原创 实现显卡、声卡
public class Assembler { public static void assemble(PCI pci){ pci.start(); pci.stop(); } public static void main(String[] args) { PCI dc = new DisplayCard(); assemble(dc); PCI sc = new SoundCard(); assemble(sc); PCI nc = new NetworkCard()
2021-05-11 19:49:51 268
原创 创建打印类
public class DotMatrixPrinter extends Printer { /** * 打印。 */ public void print() { System.out.println("打印速度慢,效果差,噪音高"); } } public class InkpetPrinter extends Printer { /** * 打印。 */ public void print() { System.out.println("打印效果介于针式和激光打印
2021-05-11 19:40:29 417
原创 设计鸟类Bied、鱼类Fish、都继承自抽象的动物类Animal,实现其抽象方法info(),输出各自的信息。
abstract class Animal { private int age = 0;//年龄 public Animal() { } public Animal(int age) { this.age = age; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public abstract void info(); } public cla
2021-05-11 19:19:54 946
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人