Then, to determine what the value of ƒ(3) is, we could do the following

double value = myMap.get(3);

(value would be set to 1.5)

How Map's are used in this code

Whenever we're working with large amounts of data, as Deepak is, we have to figure out a way to
represent that day. In this case, Map's prove usefull....

Here's what we have to represent...

A list of baseball teams. We do this using a simple array of Strings.

String[] teamNames = { "Mets", "Whitesox", "Reds", ... };

A list of players for each team. A list of players could also be represented
as an array of Strings (and we'll do that!) but how do we relate that array to a team?
We use a Map!
Specifically, we're creating a function that maps team names (a String) to a
list of players (an array of Strings)...

With that, to get the list of players on a specific team, say the Reds, all we need to do is

String[] RedsPlayers = players.get("Reds");

A list of stats for each player. A list of stats could be represented by
an array of double's (decimal numbers)... I'm guessing. I don't really know (I'm not a
baseball guy, but we'll let Deepak figure this part out, he's pretty good with the stuff
so far). Supposing we can, we'll do what we did before... we will represent the stats of
a player as an array of double's and use a Map to relate them to that player...

To see how this makes things a bit easier, take a look at the code and notice that we don't have
many variables, and we don't have to manually relate each team with a set of players (at least not
how we would have to do it with arrays). The map does this for us.