310策略模式

47 阅读1分钟

定义

定义一组算法,将每个算法封装起来,并且它们之间可以互换。策略模式让算法独立与使用它的客户而变化,也成为政策模式。

类图

图片2.png

代码

public class StrategyPattern {
    public static void main(String[] args) {
       // ThreadPoolExecutor executor = new ThreadPoolExecutor();
    }
}