So i need to write a method that will find the even numbers of a passed array and return them back to the user. But, i am not returning them back as an array, but rather as ints. I am not sure why i am struggling with this. I am probably just overlooking something minor. I know how to get it to work if i was to return an array. any advice would be greatly appreciated. Here is the method.
public static int numEven(int list[]){
int evens = 0;
System.out.print("The even numbers in your array are: ");
for(int i = 0;i < list.length; i++ )
if(list[i] % 2 == 0)
evens = list[i];
return evens;
}