I'm making a Java function randomize which gets one argument, an array of Objects.
Basically, this function randomizes the entire array and since the type of data isn't relevant, the method signature is: public static Object[] randomize(Object[] array)
.
However, this doesn't work for arrays of int, double etc.. (so for arrays of primitives). How can I get this to work? I don't want to have one function for objects and 8 overloaded functions for each of the primitive types. I can accept if there is one function for Object arrays and one function for ALL of the primitive types. How can I do this?
Thank you, Héctor