Search an element in an unknown sized array. Java.