Question: Which is one of the lines output by this code? A. [] B. [8] C. [9] D. [10] E. The code does not compile. 10:
Which is one of the lines output by this code?

A. []
B. [8]
C. [9]
D. [10]
E. The code does not compile.
10: var list = new ArrayList (); 11: list.add (10); 12: List.add(9); 13: list.add(8); 14: 15 var num = 9; 16: list.removeIf (x -> {int keep = num; return x == keep; }); 17: System.out.println(list); 18: 19: num = 8; 20 list.removeIf (x -> {int keep = num; return x == keep; }); 21: System.out.println(list);
Step by Step Solution
3.49 Rating (152 Votes )
There are 3 Steps involved in it
The code provided is in Java and demonstrates the use of an ArrayList along with the removeIf method ... View full answer
Get step-by-step solutions from verified subject matter experts
