title: can't return arrayList from method
body: <p>So I'm teaching myself Java and not that great at it yet, but trying my hand at making a game. I'm trying to return an arraylist from a class method, but it keeps giving me a "int cannot be dereferenced" error.  This is a method from a class called Levels. It should create a list of aliens and return it to the main game. I have a bunch of classes that extend sprite to represent different enemies. So alien# extends sprite. </p>
  
  <pre><code>public ArrayList&lt;Sprite&gt; sendWave(){
      aliens = new ArrayList&lt;Sprite&gt;();
      aliens.add(new Alien1(100, 50, difficulty));
      // etc
      return aliens;
  }
  </code></pre>
  
  <p>later in the board class which draws everything, I want to read that ArrayList. I've got this currently: </p>
  
  <pre><code>public void initAliens() {
      Levels level = new Levels();
      ArrayList&lt;Sprite&gt; aliens = new ArrayList&lt;&gt;();     
      aliens.addAll(level.sendWave()); 
      // blah blah
  }
  </code></pre>
  
  <p>I've also tried:</p>
  
  <pre><code>aliens = level.sendWave();
  </code></pre>
  
  <p>or even just testing the method alone by doing:</p>
  
  <pre><code>level.sendWave();
  </code></pre>
  
  <p>It always gives me that "int cannot be dereferenced" error. I don't really understand what that means. What int? Am I returning the arraylist incorrectly or something? </p>