Question: Im given a task which i am a little confused to understand. Here is the question statement:

---

The following program should read a file and store all its tokens in a member variable.
Your task is to write a single method that returns the number of items in tokenMap, the average length (as double value) of the elements in tokenMap, and the number of tokens starting with character "a".

---

Here the tokenMap is an object of type `HashMap<String, Integer>`;

I do have some idea about HashMap but what i want to know the "key value" for HashMap required is a single character or the whole word?? that i should store in tokenMap.

Also how can i compute the average length?

Answer: 
Looks like you have to use the entire word as the key.

The average length of tokens can be computed by summing the lengths of each token and dividing by the number of tokens.

In Java, you can find the number of tokens in the HashMap by tokenMap.size().

You can write loops that visit each member of the map like this:

```
  for(String t: tokenMap.values()){
     //t is a token
  }

```

and if you look up String in the Java API docs you will see that it is easy to find the length of a String.
Guys there is some confusion. Im not asking for a solution. Im just confused for one thing.
For the time being, im gonna use String type as the key type.

The only confusion i have is once i read the file line by line, should i split it based upon words or based upon each character. So that the key value should be a single character type string or a String of whole word.

If you can go through the question statement, what do you suggest. That's all im asking.