lambda表达式和匿名内部类

public class TestMain {
	public static void main(String[] args) {
		TT tt = s -> {
			List<String> list = Arrays.asList(s);
			list.forEach( ss -> System.out.println(ss));
		};
		
		tt.tt(new String[] {"ss","s","dd"});
	}
	
	
	interface TT {
		void tt(String ...strings);
	}
}

猜你喜欢

转载自yaohongxing.iteye.com/blog/2293665