class A {
}
class B extends A {
public static void main(String args[]) {
B b = new A();
}
}
Why does this throw a compile time error? to suppress the compile time error we can do B b=(B)new A(); but then also it will through ClassCastException.
