title: How to print nested Map?
body: <p>I have a problem right now as I can't figure out how to print out a nested Map. I have a List from where I get data and I think I have to first check if the student has the same matrikelnummer as the student has and then I can add it with calling the fachUndNote method to the Map of fach which I am getting back as a Map to put it in the StudentFachNote map.. hope you can get it.. How do I print the nested map to have an output as in the second screenshot?</p>
  <p><a href="https://i.stack.imgur.com/dP7CP.png" rel="nofollow noreferrer">screenshot as it has to look like</a></p>
  <p><a href="https://i.stack.imgur.com/bLtfH.png" rel="nofollow noreferrer">code</a></p>
  <pre><code>        for (int i = 0; i &lt; datenAllerStudenten.size(); i++) {
              String zeile = datenAllerStudenten.get(i);
              String[] split = zeile.split(&quot;;&quot;);
              String name = split[0];
              int matrikelnummer = Integer.parseInt(split[1]);
              String lieblingsfach = split[2];
              Student student = new Student(name, matrikelnummer, lieblingsfach);
  
              String zeile2 = datenAllerNoten.get(i);
              String[] split2 = zeile2.split(&quot;;&quot;);
              int matrikelnummer2 = Integer.parseInt(split2[0]);
              String semester = split2[1];
              String fachName = split2[2];
              String note = split2[3];
              Fach fach = new Fach(fachName, semester);
              Student.fachUndNote(fach, note);
  
              studentFachNote.put(student, Student.fachUndNote(fach, note));
          }
          for (Entry&lt;Student, Map&lt;Fach, String&gt;&gt; e : studentFachNote.entrySet()) {
              Student coordX = e.getKey();
              System.out.println(coordX + &quot;--&gt;&quot;);
  
          }
  </code></pre>