Why the first call to constructor takes 10 times more time than other ones?

Viewed 424
class testx
{
  public testx()
  {
    long startTime = System.nanoTime();
    System.out.println((System.nanoTime() - startTime));
  }

  public static void main(String args[])
  {
      new testx();
      new testx();
      new testx();
  }
}

I always get results similar to this 7806 660 517. Why the first call takes 10 times more time than other ones?

2 Answers
Related