Question: Rewrite this lambda that takes an int n using a constructor reference: n -> new ArrayList (n). A. ArrayList::new B. ArrayList::new() C. ArrayList::new(n) D. ArrayList::new[n]
Rewrite this lambda that takes an int n using a constructor reference: n -> new ArrayList<>(n).
A. ArrayList::new
B. ArrayList::new()
C. ArrayList::new(n)
D. ArrayList::new[n]
E. None of the above.
Step by Step Solution
3.41 Rating (151 Votes )
There are 3 Steps involved in it
The correct answer is A ArrayListnew In Java 8 lambda expressions can be replace... View full answer
Get step-by-step solutions from verified subject matter experts
