title: How to run through multiple if statements
body: <p>When I run this code it will only do some of the if statements until it finds one that is true. How to I make it run through all of the if statements.</p>
  
  <pre><code>for (int c = 0; c &lt;= 9; c++) {
      for (int r = 0; r &lt;= 9; r++) {
          try {
              if (Sprite.mine_1[c - 1][r - 1] &lt; 20) Sprite.count++; //top left
              System.out.println("if 1");
              if (Sprite.mine_1[c - 1][r] &lt; 20) Sprite.count++; //left
              System.out.println("if 2");
              if (Sprite.mine_1[c - 1][r + 1] &lt; 20) Sprite.count++;  //buttom left
              System.out.println("if 2");
              if (Sprite.mine_1[c][r + 1] &lt; 20) Sprite.count++;  //buttom    
              System.out.println("if 4");
              if (Sprite.mine_1[c + 1][r + 1] &lt; 20) Sprite.count++;  //buttom right  
              System.out.println("if 5");
              if (Sprite.mine_1[c + 1][r] &lt; 20) Sprite.count++;  // right    
              System.out.println("if 6");
              if (Sprite.mine_1[c + 1][r - 1] &lt; 20) Sprite.count++;  // right to
              System.out.println("if 7");
              if (Sprite.mine_1[c][r - 1] &lt; 20) Sprite.count++;  //top
              System.out.println("if 8");
          } catch (ArrayIndexOutOfBoundsException exception) {
          }
      }
  }
  </code></pre>