Java function with list of classes implementing interface as argument

Multi tool use
Multi tool use
The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Java function with list of classes implementing interface as argument



I have a list of classes which implement a certain interface:


List<Class<? extends DatabaseField>> models = new ArrayList<Class<? extends DatabaseField>>();



I would like to pass this list to a function which iterates over that list, and uses one or two interface functions.



What would the function signature look like?



I have tried things such as:


public static void <List<Class<T implements DatabaseField>> myMethod(List<Class<T>> myList)



And am not sure how to proceed.





What's wrong with public static void myMethod(List<Class<? extends DatabaseField>> myList)? Though, it's unclear how you actually intend to use this list in the first place. Maybe you should include an example of what you're trying to do.
– VeeArr
2 mins ago




public static void myMethod(List<Class<? extends DatabaseField>> myList)









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

A917oh iK7MJLbPRWYwOc870L C29X Wti Ar,C7oOAlY2drDU51BHN5adX n7,U,eh3VPqxbxnmIJe,UsFXJbilpu8,gZG6M9is X
ky3p 89jtEYDqYTU

Popular posts from this blog

Keycloak server returning user_not_found error when user is already imported with LDAP

PHP parse/syntax errors; and how to solve them?

415 Unsupported Media Type while sending json file over REST Template