摘要: 1.父类对象可以强制转换为子类对象,但是前提是此父类对象为子类对象实例化的结果。 e.g. Fruit fruit=new Apple(); Apple a=(Apple)fruit;//ok e.g. 假设Apple类继承于Fruit类, Object fruit=new Fruit(); Obj 阅读全文
posted @ 2016-08-14 11:13 梦中山河 阅读(785) 评论(0) 推荐(0)