Parts of code

Report a typo

There are some parts of the code with closures. Find the correct one.

1)

int a = 3;
Function<Integer, Integer> f = (x) -> a * x;
a++;

2)

final int a = 3;
Function<Integer, Integer> f = (x) => a * x;

3)

int a = 3;
Function<Integer, Integer> f = (x) -> a * x;

4)

int a = 3;
Function<Integer, Integer> f = (x) => a * x;
a++;

5)

final int a = 3;
Function<Integer, Integer> f = (x) := a * x;
Select one option from the list
___

Create a free account to access the full topic