标签:oid 超级 list express sys lam ring 表达 集合
语法格式:(parameters) -> expression 或 (parameters) ->{ statements; }
创建一个String类型的数组
static String[] atp = {"11", "22","33", "44", "55", "66"};
用Arrays的asList方法将其转换为List集合
static List<String> players = Arrays.asList( atp );
//以前使用超级for循环遍历集合
public static void main(String[] args) {
for (String player : players) {
System.out.print( player + "; " );
}
//使用 lambda 表达式以及函数操作(functional operation)
//players.forEach((player) -> System.out.print(player + "; "));
标签:oid 超级 list express sys lam ring 表达 集合
原文地址:https://www.cnblogs.com/fdbk/p/9472487.html