title: Using for-loop to test day count in Java
body: <p>Firstly, bear with me – I'm only about a month into Java.</p>
  
  <p>In an exercise, I'm asked to proof (with a test unit) that from a certain year (x) to a certain other year (y) that there are only one day between 31st of December and the 1st of January. They suggest that I should use a for-loop to make it run through all the years in-between our x and y year.</p>
  
  <p>A predefined method called daysTill is already created.</p>
  
  <p>So far, I've come up with this ugly piece of code, which doesn't work:</p>
  
  <pre><code>public void testYearEnd()
  {int i;
         for(i = 1635; i &lt;=2300; i++);
              Date date1 = new Date(i, 31, 12);
              Date date2 = new Date(i, 01, 01);
              assertEquals(1, date1.daysTill(date2));
  }
  </code></pre>
  
  <p>Can anyone bear to point out exactly where my code is failing on me?</p>