I am writing a method that takes as a single parameter a list of comparable objects and returns nothing. I am not sure of the syntax that should have:
public static void methodName(List<Comparable<Object>> list) {
I think this is wrong due to <Object>
as a type for Comparable, which would mean that the list can accept Integer and Boolean as objects, but I don't want that. I want the list to accept only one type, but this type should implement the Comparable interface. How do I achieve this?
source share