title: Dictionary of ArrayLists in Java
body: <p>I'm trying to write a simple program in Java in educational purposes.
  Basicly you can add students and those grades and after all collect some statistics like average students grade or filtering "good" students apart from "bad" students, etc.
  After you run the application in terminal you are able to add student so: <code>-add &lt;name&gt;</code>, add students grade so: <code>-addg &lt;name&gt; &lt;grade&gt;</code></p>
  
  <p>So I want the application to store student names and list of those grades. The data struture is pretty simple (that is what I want now, at least it seems to be proper structure for this task. It represents simple associative array of arrays in <code>PHP</code> or dictionary of lists in <code>Python</code>):</p>
  
  <pre><code>+---------------------+---------------------+
  | String name         | ArrayList grades    |
  +---------------------+---------------------+
  | String anotherName  | ArrayList grades    |
  +---------------------+---------------------+
  </code></pre>
  
  <p>This would be coded pretty simple in <code>PHP</code> or <code>Python</code>, but in <code>Java</code> I've ran into a problem:
  I just can't construct such structure:</p>
  
  <pre><code>$ javac StudentGrades.java
  StudentGrades.java:19: variable grades might not have been initialized
                  grades.add(5.0f);
                  ^
  Note: StudentGrades.java uses unchecked or unsafe operations.
  Note: Recompile with -Xlint:unchecked for details.
  1 error
  </code></pre>
  
  <p><code>StudentGrades.java</code>:</p>
  
  <pre><code>public class StudentGrades {
  
      Dictionary studentGrades;
  
      /**
       * @param args the command line arguments
       */
      public void main(String[] args) {
          //Scanner scanner = new Scanner(System.in);
          ArrayList grades;
          boolean res;
          grades.add(5.0f);
          this.studentGrades.put("Nemoden", grades);
      }
  </code></pre>
  
  <p>Could you please point me what am I doing wrong and how it should be done properly. 
  Thank you.</p>