Which of the following would not be correct in the underline: public class Test
ID: 3834305 • Letter: W
Question
Which of the following would not be correct in the underline: public class Test { public static void main(String[] args) { Test test = new Test(); test.setAction2(______________________________); } public void setAction2(T2 t) { t.m(4.5); } } interface T2 { public void m(Double d); }
() -> System.out.print(e)
(e) -> System.out.print(e)
e -> System.out.print(e)
(e) -> {System.out.print(e);}
() -> System.out.print(e)
(e) -> System.out.print(e)
e -> System.out.print(e)
(e) -> {System.out.print(e);}
Explanation / Answer
setAction2() method is expecting an object of class type T2.
So, the answer is:
() -> System.out.print(e)
() -> System.out.print(e)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.