I want to randomly be able to return a person's name in a map using the method randomizeName
(int group); I want it to randomize the Strings in a Map called people.
Here is how people looks:
public Map<Integer, String> people = new HashMap<Integer, String>();
There are three groups in people, 1, 2, and 3.
There are nine Strings in this HashMap, each associated with a group:
Greg, George, Fred, Marie, Ann, Julie, Alfred, Bob, and Julian.
How do I return a randomized String only in group one, for example.
So instead of it randomizing the Strings in the entire Map, how do I make it only randomize the people in group one(Greg, George and Fred)
?
Here is the method:
public String randomizeName(int group){
//Enter Code Here
}