How do I get specific children classes from an ArrayList?
<p>I've got a class called "Entity", this is extended by other classes such as "Player" and the "Slime" mob. In another class called "Level" I have an ArrayList called entities, now I add these separate classes to the ArrayList.</p>

<pre><code>for (Entity entity : entities) {
    entities.add(entity);
}
</code></pre>

<p>How do I check, while looping through the ArrayList, if the current object is either a Player or Slime?</p>

<pre><code>for (Entity entity : entities) {
    if (entity == Player) {
        System.out.println("Player class!");
    }
}
</code></pre>

<p>Obviously that doesn't work, but how can I do that? Thanks for any help :)</p>
