title: Calculating the sum of all odd array indexes
body: <p>I want to calculate the sum of all odd array indexes, but I'm having some trouble finding the right way to do it. </p>
  
  <p>Here's my code so far:</p>
  
  <pre><code>    String id = "9506265088085";
      String[] strArray = id.split("");
  
      int[] intArray = new int[strArray.length];
  
      int sum = 0;
  
      for (int i = 0; i &lt; 6; i++) {
  
          if (i%2!=0)
          {
              sum += Integer.parseInt(String.valueOf(id.charAt(i)));
  
          }} 
  
          System.out.println(sum);
  </code></pre>
  
  <p>Any ideas on why this isn't working, or simpler ways to do it? To clarify I want to add all the numbers in the odd array index positions, so <code>intArray[1] + intArray[3] + intArray[5] + ...</code>. </p>
  
  <p><strong>Edit:</strong>
  Forgot to mention I only want to add 1, 3, 5, 7, 9, 11 and not 13.</p>