title: How to print List's object elements in Java?
body: <p>I have something like the following:</p>
  
  <pre><code>List&lt;Interval&gt; intervals = new LinkedList&lt;Interval&gt;();
  intervals.add(new Interval(1));
  intervals.add(new Interval(2));
  </code></pre>
  
  <p>How can I print the List <code>intervals</code>? I attempted <code>System.out.println(intervals)</code>, but it simply returns <code>[Interval@...]</code>. </p>
  
  <p>Thank you</p>