Question: Element Removal Given the Lists instruments and stringedlnstruments, remove all of the languages found in stringedInstruments from instruments. Then, the console. ` ` ` import

Element Removal
Given the Lists instruments and stringedlnstruments, remove all of the languages found in stringedInstruments from instruments. Then, the console.
```
import java.io.*;
import java.util.*;
public class CodingQuestion {
public static void main(String[] args){
List instruments = new ArrayList>();
instruments.add("Guitar");
instruments.add("Drums");
instruments.add("Flute");
instruments.add("Violin");
instruments.add("Saxophone");
instruments.add("Cello");
List stringedInstruments = new ArrayList>();
stringedlnstruments.add("Guitar");
stringedInstruments.add("Violin");
stringedlnstruments.add("Cello");
stringedlnstruments.add("DoubleBass");
stringedlnstruments.add("Viola");
```
/***** DO NOT CHANGE THE CODE ABOVE THIS LINE *****/
// WRITE YOUR CODE HERE
instruments.removeAll(stringedlnstruments);
System.out.println(instruments);
}
}
STDOUT
Expected STDOUT
Non-stringed instruments: [Drums, Flute, Saxophone]
Element Removal Given the Lists instruments and

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!