Flawed Logic in If statement : <p>I tried the year 1900, which in my program prints its a leap year, however, 1900 shouldnt be a leap year. Can someone help me with the logic behind the if condition?</p>

<pre><code>class LeapYearTrial{
public static void main(String[]args){

   String s;
   int year;

   s = JOptionPane.showInputDialog("Enter year");
   year = Integer.parseInt(s);

   if ((year % 100 == 0) &amp;&amp; (year % 400 == 0) || (year % 4 == 0)){ 

      JOptionPane.showMessageDialog(null, year + " is a leap year"); 

   } else {

      JOptionPane.showMessageDialog(null, year + " is not a leap year");
      }
   }
}
</code></pre>
