title: how to fix the code that refuses to show the result?
body: <p>I'm trying to reverse the elements of an array.My code has no compiling      error or run time error , but still it refuses to show the result.</p>
  
  <p>I've tried every possible alternate methods according to my knowledge.</p>
  
  <pre><code>class mark25 {
      public static void main(String args[]) {
          int arr[] = {
              1,
              2,
              3,
              4,
              5
          };
          int len = arr.length;
          boolean flag = true;
          while (flag) {
              for (int i = 0; i &lt; len - 1; i++) {
                  int temp = arr[i];
                  arr[i] = arr[len - 1];
                  arr[len - 1] = temp;
                  if (i &gt; len - 1) {
                      flag = false;
                  }
              }
  
          }
          for (int j = 0; j &lt; len; j++) {
              System.out.println(arr[j]);
          }
      }
  }
  </code></pre>
  
  <p>I expect the code to show  reversed order of the the array "arr".</p>