public static boolean contains(float item, float[] array)Apart from that, in this special case, everything would be the same. The reason is that the comparison operators < and > are overloaded, and apply both to int and float. On the other hand, if you wanted to search an array of strings, you would have to modify the code. The operators < and > do not apply to strings in Java. Instead you need to use the String.compareTo method, which returns 0 if the strings are equal, or a positive or negative integer depending on whether this string is later or earlier in the ordering than the other.