摘要: import java.nio.channels.Pipe; public class 享元模式 { public static void main(String[] args) { pieceFactory factory=new pieceFactory(); Piece whitePiece= 阅读全文
posted @ 2023-10-30 21:49 辞楠 阅读(11) 评论(0) 推荐(0)
摘要: public class 装饰器模式 { public static void main(String[] args) { //第一种写法 Person person=new Student("张三"); person.Operation(); System.out.println(); perso 阅读全文
posted @ 2023-10-30 20:53 辞楠 阅读(11) 评论(0) 推荐(0)
摘要: import java.util.ArrayList; import java.util.List; public class 组合模式 { public static void main(String[] args) { AbstractFile fileA=new File("fileA"); 阅读全文
posted @ 2023-10-30 19:45 辞楠 阅读(21) 评论(0) 推荐(0)