Code: Select all
List<Integer> names = Arrays.asList(1, 2, 3); //1
names.forEach(x->x=x+1); //2
names.forEach(System.out::println); //3
Shouldn't it be it will not compile due to code at //2?
Moderator: admin
Code: Select all
List<Integer> names = Arrays.asList(1, 2, 3); //1
names.forEach(x->x=x+1); //2
names.forEach(System.out::println); //3
I think the question was:
Users browsing this forum: Bing [Bot] and 44 guests