title: I am trying to figure out how to print this array list that I sorted
body: <p>I was using this code to print out the list of objects and i don't know if it was because i sorted them but it wont print correctly.</p>
  <pre><code>Collections.sort(cereal);
  for (int i = 0; i&lt;cereal.size(); i++){
      System.out.println(cereal.get(i).toString());
  }
  </code></pre>
  <p>I used this compare method for it and I'm not sure if it works either.</p>
  <pre><code>@Override
  public int compareTo(Cereal o) {
      return (int) (this.ratings - o.getRatings());
  }
  </code></pre>
  <p>Thank you for the feedback.
  Here is what is printing:</p>
  <pre><code>Unit3_7.Cereal@668bc3d5
  Unit3_7.Cereal@3cda1055
  Unit3_7.Cereal@7a5d012c
  Unit3_7.Cereal@3fb6a447
  Unit3_7.Cereal@79b4d0f
  Unit3_7.Cereal@6b2fad11
  </code></pre>
  <p>This is a sample by the way and this is the object:</p>
  <pre><code>Cereal cereal1 = new Cereal(data[0], data[1],
                                  Integer.parseInt(data[2]),
                                  Integer.parseInt(data[3]),
                                  Integer.parseInt(data[4]),
                                  Integer.parseInt(data[5]),
                                  Double.parseDouble(data[6]),
                                  Double.parseDouble(data[7]),
                                  Integer.parseInt(data[8]),
                                  Integer.parseInt(data[9]),
                                  Integer.parseInt(data[10]),
                                  Integer.parseInt(data[11]),
                                  Double.parseDouble(data[12]),
                                  Double.parseDouble(data[13]),
                                  Double.parseDouble(data[14]));
  </code></pre>
  <p>I'm getting the data from a csv file that I parsed also, I already confirmed it works and also here is the definition</p>
  <pre><code>public Cereal(String brandName, String type, int calories, int protein, int fat, int sodium, Double fiber, Double carbohydrates, int sugar, int potassium, int vitamins,int shelf,
              Double weight, Double cups, Double ratings) {
      this.brandName = brandName;
      this.type = type;
      this.calories = calories;
      this.protein = protein;
      this.fat = fat;
      this.sodium = sodium;
      this.fiber = fiber;
      this.carbohydrates = carbohydrates;
      this.sugar = sugar;
      this.potassium = potassium;
      this.vitamins = vitamins;
      this.shelf = shelf;
      this.weight = weight;
      this.cups = cups;
      this.ratings = ratings;
  }
  
  </code></pre>