上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 16 下一页
摘要: public class 中介者模式 { public static void main(String[] args) { Mediator mediator=new ConcreteMediator(); ColleagueA colleagueA=new ColleagueA(mediator) 阅读全文
posted @ 2023-10-31 22:23 辞楠 阅读(17) 评论(0) 推荐(0)
摘要: import java.util.ArrayList; import java.util.List; public class 访问者结构 { public static void main(String[] args) { Visit visit1=new VisitA(); Visit visi 阅读全文
posted @ 2023-10-31 21:32 辞楠 阅读(18) 评论(0) 推荐(0)
摘要: public class 策略模式 { public static void main(String[] args) { Strategy add=new ConcreteStrategyA(); Strategy sub=new ConcreteStrategyB(); Strategy mult 阅读全文
posted @ 2023-10-31 19:31 辞楠 阅读(17) 评论(0) 推荐(0)
摘要: public class 状态模式 { public static void main(String[] args) { Context context=new Context(); context.Request(); context.Request(); context.Request(); / 阅读全文
posted @ 2023-10-31 17:37 辞楠 阅读(16) 评论(0) 推荐(0)
摘要: import java.util.ArrayList; import java.util.List; public class 观察者模式 { public static void main(String[] args) { Subject subjectA = new ConcreteSubjec 阅读全文
posted @ 2023-10-31 16:31 辞楠 阅读(17) 评论(0) 推荐(0)
摘要: public class 命令模式 { public static void main(String[] args) { Tv tv=new Tv(); Command onCommand=new OnCommand(tv); Command offCommand=new OffCommand(tv 阅读全文
posted @ 2023-10-31 15:15 辞楠 阅读(17) 评论(0) 推荐(0)
摘要: 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)
摘要: 类图 代码 package test; import java.util.ArrayList; import java.util.List; public class Test4 { public static void main(String[] args) { Director director 阅读全文
posted @ 2023-10-26 21:46 辞楠 阅读(14) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 16 下一页