title: Why is the output to this code both 2?
body: <pre><code>public class Bird
  {
  private static int id = 0;
  private String kind;
  public Bird(String requiredKind)
  {
      id = id + 1;
      kind = requiredKind;
  }
  public String toString()
  {
      return "Kind: " + kind + ", Id: " + id + "; ";
  }
  public static void main(String [] args)
  {
      Bird [] birds = new Bird[2];
      birds[0] = new Bird("falcon");
      birds[1] = new Bird("eagle");
      for (int i = 0; i &lt; 2; i++)
          System.out.print(birds[i]);
      System.out.println();
  }
  }
  </code></pre>
  
  <p>I understand that because int is static both id's will be the same but can't figure out why the output is 2 instead of 1?</p>
  
  <p>Output when run:</p>
  
  <pre><code>Kind: falcon, Id: 2; Kind: eagle, Id: 2; 
  </code></pre>