Question: JAVA 2. You are given two arrays of Strings - (i) array soccer consists of names of students who play soccer in a large school,
JAVA

2. You are given two arrays of Strings - (i) array soccer consists of names of students who play soccer in a large school, and (ii) array volleyball consists of names of students who play volleyball in the school. Notice that there may be students who play both sports. Names can be one word, two words or three words consisting of alphabetic characters. Write methods to perform the following actions: (20 points) (i) soccerOnly (..) that returns students who play only soccer via a suitable data structure. (ii) volleyBallOnly(..) that returns students who play only volleyball via a suitable data structure. (iii) bothSports(..) that returns students who play both sports via a suitable data structure. No duplicates allowed
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
