Please look into following code. Why this error is thrown even though Integer is inherited from Number and why the same case of error is not there when '? extends Number' is used.
public class testGeneric
{
public static void main(String[] args)
{
Class<Integer> classint = int.class;
Class<Number> classnum1 = int.class;// Error Type mismatch: cannot convert from
// Class<Integer> to Class<Number>
Class<? extends Number> classnum2 = int.class;
}
}