Java SE 11 Developer (1Z0-819) — Question 190

Which is a valid statement?

Answer options

Correct answer: B

Explanation

Option B is correct because it uses the proper syntax for a BiPredicate, allowing both parameters to be of the 'var' type. Option A restricts the second parameter to an Integer, which is not generic. Option C has a syntax error with the missing parentheses, and Option D lacks type declaration for the second variable, making it invalid.