Inconvertible Types


The “inconvertible types” error occurs when the Java code tries to perform an illegal conversion.
TypeInvocationConversionTest.java:12: inconvertible types
found   : java.util.ArrayList<java.lang.Class<? extends TypeInvocationConversionTest.Interface1>>
required: java.util.ArrayList<java.lang.Class<?>>
    lessRestrictiveClassList = (ArrayList<Class<?>>) classList;
                                                     ^

For example, booleans cannot be converted to an integer.