title: print a leap year in a certain format
body: <p>i would like to print leap years in between two years given in a format like
  '[2120,2024,2028]'.i want them with these commas and square brackets..kindly help me with this.in java
  my program:</p>
  
  <pre><code>System.out.print("[");
  for(int i=2017;i&lt;=2040;i++)
  {
      if(i%4==0)
      {
          System.out.print(i);
          if(i!=2040)
          {
              System.out.print(",");
          }       
      }
  }
  System.out.print("]");
  </code></pre>
  
  <p>if i change the value the comma is not working right</p>