定义策略接口
public interface HelloStrategy {
String hello();
}
实现策略接口
@Component("ChineseHelloStrategy")
public class ChineseHelloStrategy implements HelloStrategy {
@Override
public String hello() {
return "你好";
}
}
@Component("EnglishHelloStrategy")
public class EnglishHelloStrategy implements HelloStrategy {
@Override
public String hello()<