title: Why is for loop executed when the condition should be false?
body: <p>I have the following code :</p>
  
  <pre><code>    public int maxSpan(int[] nums) {
        int maxSpan = 0;
        int span;
        int j;
        for(int i = 0; i &lt; nums.length; i++)
        {
           for(j = nums.length - 1; nums[i] != nums[j]; j--);
           span = 1 + j - i;
           if(span &gt; maxSpan)
              maxSpan = span;
        }
        return maxSpan;
     }
  </code></pre>
  
  <p>Edit: I realised that there is a semicolon instead of {, which is actually why it is working so now my question is, is this bad practice?
  Thanks in advance!</p>