title: Can someone explain to me what this Array Java program wants me to do?
body: <p>I am stuck on this one problem on Arrays. I haven't started the program yet because I really don't understand what it wants me to do! Here is the problem:</p>
  
  <p><strong>Write a method called wordLengths that accepts a String representing a file name as its argument. Your method should open the given file, count the number of letters in each token in the file, and output a result diagram of how many words contain each number of letters. For example, the following text:</strong></p>
  
  <blockquote>
    <p>Before sorting:</p>
    
    <p>12 23 480 -18 75</p>
    
    <p>hello how are you feeling today</p>
    
    <p>After sorting:</p>
    
    <p>-18 13 23 75 480</p>
    
    <p>are feeling hello how today you</p>
  </blockquote>
  
  <p><strong>your method should produce the following output to the console:</strong></p>
  
  <pre><code>1: 0    
  
  2: 6    [There should be 6 * printed here]
  
  3: 10   [There should be 10 * printed here]
  
  4: 0
  
  5: 5    [There should be 5 * printed here]
  
  6: 1    [There should be 1 * printed here]
  
  7: 2    [There should be 2 * printed here]
  
  8: 2    [There should be 2 * printed here]
  </code></pre>
  
  <p>So StackOverflow is rather limited, so I wasn't able to show you the full style of the output, but in summary, the "Before Sorting:"  part that is followed by 2 sentences are one group, "After sorting:" and the 2 sentences below are another group. The "before" and "after" sorting are separated by one space.</p>
  
  <p>I don't get how the output is achieved, that's my problem. I have a feeling that the 1-8 represents line numbers, but what do the 0, 6, 10, etc. represent? Because when I counted the word lengths, they exceeded 6 or 10...
  It'd be a great help if someone could explain to me what this program wants me to do. </p>
  
  <p>Thanks in advance!</p>