title: How to get a number from an array?
body: <p>question:<br>
      Suppose this is the number in my array <code>{1,2,3,4,5,6,7,8}</code>
      and each number is a position like ::
      <code>1=1 ,2=2 , 3=3,  4=4,  5=5,  6=6,  7=7,  8=8</code></p>
  
  <p>It is not an array position just the number position. Now i want to remove the number in odd position then it becomes </p>
  
  <pre><code>2,4,6,8 :: 2=1, 4=2,  6=3,  8=4,
  </code></pre>
  
  <p>Now again i want to remove from the odd position so it becomes <code>4,8 :: 4=1,  8=2</code></p>
  
  <p>Now the answer is <code>8</code> so how to get this <code>8</code> </p>
  
  <p>Code:</p>
  
  <pre><code>int [] arr = new int [] {1, 2, 3, 4, 5, 6, 7, 8}; //I am taking certain number in array   
  System.out.println("Elements of given array present on even position:"); 
  for (int i = 1; i &lt; arr.length; i = i+2) {   
            System.out.println(arr[i]);
  }
  </code></pre>
  
  <p>must get the value as 8 but in output i get:</p>
  
  <pre><code>2 
  2
  2
  2
  4
  4
  4
  4
  </code></pre>
  
  <p>and so on</p>