I want to return odd numbers of an array yet Eclipse doesn\'t seem to accept my return array[i]; code. I think it requires returning a whole array since I set a
public int getElement(int[] arrayOfInts, int index) {
return arrayOfInts[index];
}
Main points here are method return type, it should match with array elements type and if you are working from main() - this method must be static also.