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;
}
}
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;
}
}
相关文章推荐
- MFC中的RTTI(Runtime Type Identification, 运行时类型识别)详解(参考《深入浅出MFC》)
- RTTI运行阶段类型识别(Runtime Type Identification)
- 7.3 执行期类型识别(Runtime Type Identification,RTTI)
- RTTI(Runtime Type Identification)
- RTTI(RunTime Type Identification,运行时类型识别)
- RTTI (Runtime Type Identification)
- RTTI(Runtime Type Information )
- C++ - RTTI(RunTime Type Information)执行时类型信息 具体解释
- RTTI(Run-Time Type Identification,通过运行时类型识别)
- 三十三、RTTI(runtime type information)、dynamic_cast运算符、typeid运算符、type_info
- C++ - RTTI(RunTime Type Information)运行时类型信息 详解
- RTTI(Run-time Type Identification)
- 从头认识java-12.1 为什么需要RTTI(Run-Time Type Identification)?
- c++模拟MFC中运行时类型识别(RTTI)(Run-Time Type Identification)
- RTTI的魅力(运行时类型识别 Run-time type Identification)
- 行时类型识别(RTTI, Run-Time Type Identification)是Java中非常有用的机制 多态 类加载
- 迷思微软两大框架的RTTI(Run-Time Type Identification)
- RTTI(Run-Time Type Identification)、虚函数和虚基类的实现方式、开销分析及使用指导
- Advanced Run Time Type Identification in C++ Part II(Property Library An Implementation of RTTI in C++)
- RTTI (Run-Time Type Identification,通过运行时类型识别)