Why is the below cast possible without runtime error (i.e. ClassCastException)?
import java.lang.reflect.Type;
public class Demo {
public static void main(String[] args) {
Type t = Example.class;
Class<Demo> demo = (Class<Demo>) t;
System.out.println(demo);
}
}
Console:
class Example
.
public class Example {
}