title: Boolean with loops to check an array
body: <p>Write Java code for a loop that sets boolean variable <code>isOrdered</code> to true if the elements of a given array of ints called are in non-decreasing order, otherwise it sets isOrdered to  false. </p>
  
  <pre class="lang-java prettyprint-override"><code>int i[] = { 1, 2, 3, 4, 5 };
  int b = 0;
  boolean isOrdered = false;
  while (b &lt; i.length) {
      if (i[0] &lt;= i[b]) {
          isOrdered = true;
      }
      b++;
  }
  out.println(isOrdered);
  </code></pre>
  
  <p>Am I doing this correctly?</p>