String A = "Sample"; List<String> val; for (int i = 0; i < 5; i++) { val.add(A + i); }
我的输出将是Sample1,Sample2,Sample3等。我可以知道如何使用lambda表达式在单行中处理此脚本吗