您的位置:首页 > 其它

RTTI-Runtime type identification

2011-02-22 17:31 351 查看
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;
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: