title: Calling method in main method
body: <p>I want this code to generate a random number between one and five and then, using that number, chose a symbol out of my <code>arraylist</code> and print it.  Whenever I try to call the <code>printSymbol()</code> method it tells me to change it and the <code>arraylist</code> to static.  When I do it gives me two errors on the method call line in my main method and the line where it says that <code>String y = list.get(x);</code>  I want to know how to make it so I can call this method and get it to print String y for me.</p>
  
  <pre><code>import java.util.*;
  import java.lang.Math;
  public class study {
  public static void main(String[] args) {
      printSymbol();
  }
  ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;();
  public void addSymbols(){
      list.add("あ");
      list.add("い");
      list.add("う");
      list.add("え");
      list.add("お");
  }
  public String printSymbol(){
      int x=(int) Math.floor(Math.random()*5)+1;
      String y = list.get(x);
      return y;
  }
  
  }
  </code></pre>