public class TestLamuda {
@Test
public void testLamuda(){
MyABC myABC = new MyABC();
myABC.changeState(state -> {
System.out.println(state);
return state;
});
}
interface RunnerABC {
public String accept(String state);
}
class MyABC {
public String changeState(RunnerABC abc){
return abc.accept("");
}
}
}
lamuda 表达式demo
最新推荐文章于 2023-03-31 20:30:00 发布