Home /
Expert Answers /
Computer Science /
rearrange-the-following-lines-of-code-to-produce-a-method-that-removes-all-elements-present-in-the-pa398
(Solved): Rearrange the following lines of code to produce a method that removes all elements present in the ...
Rearrange the following lines of code to produce a method that removes all elements present in the collection a from the collection \( \mathrm{b} \) and returns how many elements were actually removed from b. Not all lines are useful. Recall that the remove method returns true if an element was removed, false if the element could not be removed because it was not present. Mouse. Drag/drop Keyboard Grab/release (or Move \( 1.1-6 \) Cancel Esc Rerhove.java Load default template. import java. util. Arraylist; import java.util. Arrays; public class Remove \& public static int removeAll(CollectioneString \( a \), co i public static void main (String [l args) Stringll bList \( = \) new String[l \( \quad \) " \( A ", ~ " B ", " C " \), "D" ArrayListestring \( a= \) new ArrayListestring (Array ArrayListestring \( b \) System, out, println( renoveAll \( (a, b)) ; \)