title: incompatible types: java.lang.String cannot be converted to int[]
body: <p>I am making a java program that prints the even and odd numbers of an array. This is my even code that returns the evens variable and prints the evens in the runner case.</p>
  
  <pre><code>public static int[] getAllEvens(int[] array)
      {  
          String evens;
  
          for(int i=0; i&lt;array.length; i++)
          {
              if(array[i]%2==0)
              {
                   evens = (array[i]+" ");
              }
          }
          return evens;   
      }
  </code></pre>
  
  <p>But when I compile, it says that the evens variable cannot be converted to int[]. I get that String or int shouldn't be used to define evens but I do not know how else I can return array[i]+" ".This is so difficult for me.</p>