I think the following question in the 1Z0-851 exam is incorrect, the correct answer is listed as "Compilation error at //2" but this should be Compilation error at //1" ?
Q: What will the following code print when compiled and run?
Code: Select all
public static void main(String args[]) {
int value = 0;
Supplier<Integer> valueS = () -> value++; //1
value++; //2
System.out.println(value + " " + valueS.get()); //3
}