title: Objects inhereting from the same parent class placed in ArrayList problem
body: <p>There is code:</p>
  <pre><code>public class Piece {
      boolean isWhite;
  
      public Piece(boolean isWhite) {
          this.isWhite = isWhite;
      }
  }
  
  
  public class Bishop extends Piece {
      public Bishop(boolean isWhite) {
          super(isWhite);
      }
  }
  </code></pre>
  <p>So if I create 2 anonymous instances of <code>Bishop</code> and set <code>isWhite</code> differently for them, they will have it.</p>
  <pre><code>System.out.println(new Bishop(true).isWhite); // prints true
  System.out.println(new Bishop(false).isWhite); // prints false
  </code></pre>
  <p>But when I place them into ArrayList, every instance in it will have <code>isWhite</code> of the first anonymous class, if it would called only once. i.e.</p>
  <pre><code>List&lt;Piece&gt; pieces = new ArrayList&lt;Piece&gt;();
  pieces.add(new Bishop(true));
  pieces.add(new Bishop(false));
  
  for (Piece p : pieces) {
      System.out.println(p.isWhite); // prints true for both, as first was set
  }
  </code></pre>
  <p>It happens if I create references too, i.e.</p>
  <pre><code>Bishop b1 = new Bishop(true);
  Bishop b2 = new Bishop(false);
  
  pieces.add(b1);
  pieces.add(b2);
  
  for (Piece p : pieces) {
      System.out.println(p.isWhite) // prints true for the both
  }
  </code></pre>
  <p>So I have no clue why does this happen =(</p>