RTTI-Runtime type identification
public class Test {
public static class A{
}
public static class B extends A{
}
public final static void main(String[] args){
A a = new A();
A a1 = null;
B b = new B();
B b1 = null;
//b1 = (B)a; //Test$A cannot be cast to Test$B
b1 = (B)a1;
}
}