Return to site
JAVA CERTIFICATION QUESTION: The correct syntax of Java lambda parameters
=>Be sure to know the difference between identifiers and specifiers.
·
Given the following functional interface:
@FunctionalInterface interface ConverterFunction<T, U, R> { R apply(T t, U u); }
And the following class fragment:
public class Converter { String doConversion(ConverterFunction<String, Integer, String> f) { // … valid implementation here } }
Which lambda expression can be used as an inline parameter for the doConversion method? Choose one.
A. (a, Integer b) -> a.repeat(b)
B. (var a, var b) -> a.repeat(b)
C. (a, var b) -> a.repeat(b)
D. (a, b, c) -> { c = a.repeat(b); return c; }
E. (String a, int b) -> a.repeat(b)
F. None of the above
·ꓭ sᴉ ɹǝʍsuɐ ʇɔǝɹɹoɔ ǝɥꓕ