title: How to return a specific element of an array?
body: <p>I want to return odd numbers of an array yet Eclipse doesn't seem to accept my return <code>array[i];</code> code. I think it requires returning a whole array since I set an array as a parameter to my method.
  As I said before, I need to pass an array and get a specific element of that array in return. Even if I make that array static, how do I return a single element?</p>
  
  <p>Edit : Alright then, here it is:</p>
  
  <pre><code>public class newClass{
  public static void main(String[] args) 
  {       
      int [] newArray= new int [4];
      int [] array = {4,5,6,7};
  
      newArray[0] = array[0]+array[1]+array[2]+array[3];
      newArray[1] = array[0]*array[1]*array[2]*array[3];
      newArray[2] = findOut(array);
  
  }
  
  public static int findOut (int [] array3)
  {
      int e1=0;
      int e2=0;
      for (int i=0; i&lt;array3.length; i++)
      {
          if (array3[i]%2==0)
          {
              e1+=array3[i];
              array3[i]=e1
              return array3[i];
          }
  
          else
          {
              e2+=array3[i];
              array3[i]=e2;
              return array3[i];
  
          }
  
      }
  
  }
  
  
  }
  </code></pre>
  
  <p>I know there are probably more than a few mistakes here but I'm working on it and I'm not only returning odd numbers, I also add them together.</p>