title: (Java) I cannot loop over my arraylist object?
body: <p>I'm trying to loop over an ArrayList object but I only get the following:</p>
  <p>Name &amp; Education:
  com.company.Item@69d9c55</p>
  <p>I have no clue why this is happening. I'm using the code provided in the MOOC course that I 'm following online, but am trying to redo this in my own small test project as I want to put what I learned into practice.</p>
  <p>Here's the code:
  Main</p>
  <pre><code>package com.company;
  
  import java.util.Scanner;
  import java.util.ArrayList;
  
  public class Main {
  
      public static void main(String[] args) {
      // write your code here
  
          Scanner scan = new Scanner(System.in);
  
          ArrayList&lt;Item&gt; itemList = new ArrayList&lt;&gt;();
          Item item;
          while(true) {
              System.out.println(&quot;Name plz?&quot;);
              String name = scan.nextLine();
              if (name.isEmpty()) {
                  break;
              }
  
              System.out.println(&quot;Education plz?&quot;);
              String education = scan.nextLine();
              if (education.isEmpty()) {
                  break;
              }
  
              item = new Item(name, education);
              if (!itemList.contains(item)) {
                  itemList.add(item);
              }
  
          }
  
          System.out.println(&quot;Name &amp; Education: &quot;);
          for(Item detail : itemList) {
              System.out.println(detail);
          }
  
      }
  }
  </code></pre>
  <p>and the main Class</p>
  <pre><code>package com.company;
  
  public class Item {
      String name;
      String education;
  
      public Item(String name, String education) {
          this.name = name;
          this.education = education;
      }
  }
  </code></pre>