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

JAVA 2. You are given two arrays of Strings - (i) array

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

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 Databases Questions!