title: How to differentiate Sub classes?
body: <p>I have Parent class and two subclasses.
  I want to make a condition in my method <code>checkType(List&lt;Parent&gt;)</code> at 
  my main class
  whether Parent.getClass() return Child1 or Child2
  Let's say i have List that stores all the objects. 
  So the checkType method could count how many child1 and child2 in the List. </p>
  
  <pre><code>abstract class Parent
  {
  ...
  
     public Parent getClass
     {
       ...
     }
  
  }
  
  class Child1 extends Parent
  {
  ...    
  }
  
  class Child2 extends Parent
  {
  ... 
  }
  </code></pre>