title: Retrieving a random item from ArrayList
body: <p>I'm learning Java and I'm having a problem with <code>ArrayList</code> and <code>Random</code>.</p>
  
  <p>I have an object called <code>catalogue</code> which has an array list of objects created from another class called <code>item</code>.</p>
  
  <p>I need a method in <code>catalogue</code> which returns all the information on one of the <code>item</code>objects in the list.<br>
  The <code>item</code> needs to be selected at random.</p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.Random;
  
  public class Catalogue
  {
      private Random randomGenerator = new Random();
      private ArrayList&lt;Item&gt; catalogue;
  
      public Catalogue ()
      {
          catalogue = new ArrayList&lt;Item&gt;();  
      }
  
      public Item anyItem()
      {
          int index = randomGenerator.nextInt(catalogue.size());
          System.out.println("Managers choice this week" + catalogue.get(index) + "our recommendation to you");
          return catalogue.get(index);
      }
  </code></pre>
  
  <p>When I try to compile I get an error pointing at the <code>System.out.println</code> line saying.. </p>
  
  <blockquote>
    <p>'cannot find symbol variable anyItem'</p>
  </blockquote>