title: Return Objects from Arraylist
body: <p>My problem is, that I want to return an Object from the <code>ArrayList</code> "blocks".
  My code doesn't work - error says <code>This method must return a result of type block</code></p>
  
  <pre><code>public block getBlockUnderneath (int x, int y){
      for(int i = 0; i&lt;blocks.size(); i++){
           if (blocks.get(i).x == x) {
               return blocks.get(i);
           }
      }
  }
  </code></pre>