I cannot find an article on how to do this, so hopefully someone can help me here. I have the following method:
^ This compiles and works, ensuring I can only pass in a List of a type extending GenericClass.public static void doSomething(List<? extends GenericClass> input) { // op }
But now I want it to accept an Array instead of List. This is where I'm stuck:
^ A wrong guess at the syntax which does not compile. Anyone know the solution? Yes, one is to convert Array into ArrayList before calling the 1st method above, but I'd rather bypass this if possible.public static void doSomething(<? extends GenericClass>[] input) { // op }