Files
javaSE260715/s-day02/src/com/inmind/generic_method06/Demo09.java
T
2026-07-31 10:53:15 +08:00

22 lines
621 B
Java

package com.inmind.generic_method06;
public class Demo09 {
public static void main(String[] args) {
//手机工厂
Factory<Phone> phoneFactory = new Factory<>();
Phone phone = new Phone();
Phone fixedPhone = phoneFactory.fix(phone);
/*
得到 二维码小卡片,发现这个师傅修得很好,这个师傅说其实我很多都能修,不仅是手机
*/
Pad pad = new Pad();
Pad fixedPad = phoneFactory.fixAll(pad);
Phone fixedPhone1 = phoneFactory.fixAll(phone);
fixedPad.playApp();
fixedPhone1.call();
}
}