摘要: 输出结果: son runfatherclass old.test$son 解释: father a = new son() 这里面 father 是静态类型,son是实际类型。 静态类型是在编译期可知的,而实际类型是在运行期才可以知道, 所以当运行run()时,取的是子类方法,而将a作为参数传入时 阅读全文
posted @ 2019-06-08 16:43 高圈圈 阅读(1252) 评论(0) 推荐(0)