I Created an array like this:
Class<? extends AbstractItem>[] itemList = {
ItemNew.class,
ItemLoad.class,
ItemSave.class,
ItemSetting.class,
ItemEnd.class
};
but java
tells me:
Cannot create a generic array of Class<? extends AbstractItem>
If I don't specify the Class generics java
warns me with:
Class is a raw type. References to generic type Class<T> should be parameterized
So who is right? and even more why doesn't it allow me to limit the Class types?
edit: the mentioned duplicate is not solving my problem, cause if I do not specify the type of the array, I can create it with compiler warning. So it is indeed possible but I am looking for the right way to achieve this)