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

A. []
B. [8, 10]
C. [8, 9, 10]
D. [10, 8]
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: list.removeIf (x -> {int keep = num; return x == keep; }); 20 System.out.println (list);
Step by Step Solution
3.41 Rating (154 Votes )
There are 3 Steps involved in it
The provided image contains Java code designed to perform operations on an ArrayList of Integer call... View full answer
Get step-by-step solutions from verified subject matter experts
