Question: java please 1.wordSet is type Multiset . What is true about the code below? wordSet.add(bird); wordSet.add(tree); wordSet.add(bird); while(wordSet.contains(bird)) { wordSet.remove(bird); } Group of answer choices
java please
1.wordSet is type Multiset
What is true about the code below?
wordSet.add("bird"); wordSet.add("tree"); wordSet.add("bird"); while(wordSet.contains("bird")) { wordSet.remove("bird"); } Group of answer choices
there is a compiler error
there will be a runtime error (an exception thrown)
there will be an infinite loop
none of these is correct
2. wordSetis type Multiset
What is true about the code below?
wordSet.add("bird"); wordSet.add("tree"); wordSet.add("dog"); while(!wordSet.isEmpty()) { wordSet.remove("cat"); } Group of answer choices
none of these is correct
there is a compiler error
there will be a runtime error (an exception thrown)
there will be an infinite loop
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
