title: Process finished with exit code 0 java
body: <p>I'm working on a code in Java, which has to be able to print all the elements in an Arraylist <code>songs</code> and also be able to randomly shuffle the elements. It worked fine before but now all of the sudden it wont even print the elements. The only thing the code prints now is:</p>
  
  <blockquote>
    <p>Process finished with exit code 0</p>
  </blockquote>
  
  <p>which means that my program stopped. I am thinking that It is maybe something with my for loop? </p>
  
  <pre><code>public void printAllSongs(){
      System.out.println("These are your current songs in your player: ");
      for (Song song : songs){
          System.out.println(song.toString());
      }
  }
  
  public static void main(String[] args) {
      MusicMaria player = new MusicMaria();
  
      player.addTrack(new Song("Timberlake", "Cry me a river", 4)); 
      player.addTrack(new Song("Shakira", "Wherever", 3));
      player.addTrack(new Song("Beyonce", "Single legs", 5));
      player.addTrack(new Song("James Brown", "It's a mans world", 3));
      player.addTrack(new Song("Ed Sheeran ", "Legohouse", 3));
      player.addTrack(new Song("Mia", "I love you", 4));
      player.addTrack(new Song("Scarlet", "Palm tree", 5));
      //player.printAllSongs();
      player.shuffle();
      player.printAllSongs();
  }
  </code></pre>