已经强制转换成了Base类型,为什么输出的是child.test()?

http://img.mukewang.com/598098430001216619201040.jpg

chrome1121
浏览 1796回答 1
1回答

莫名所以

因为子类继承了父类,重写方法后,会优先调用子类的方法。

慕瓜9220888

BAVKGPVUVHIXLEIREAEVTSHQZQGCMLJYEAGQWKQSUDTCFWTCKCSHUXUVGYDJMRETUTOMMYHBMVNSQQTCVQDVNEKTPMABZHONNJJOLTMUBRSCKVDWVLUQAHIGBQJIIYFJRTRHXGGTUUSRKTAKNXWUSRNTWSGEGEUTTTTDSGIFRKCSXCKISHBEJUSKJHQQCMKKSUUTMWEVNLKAJMGICLZPSCRVWHWYRWDQAMDCOXHCQKCXZIOXUBCTOJIRDKHUCXSINKXLOTOQMBDQNXQIEZFMZMWYJVLQXKRBALAWCMVSFNBATSSCTNDYNDIVMMQGJFAPDADNFLRDWPRLRVACHXANEOKSXSHYLYMMXTCIROCWBTFKZTWQUOTIYNAYVWOIYTISWPZWGIQFZMPAYFBPBODJKAUMBWFCLLMKSAZIRRHEIUCUEKMEVCAZXAQBOGALKHQTSSULASUTTWTXOAASCIKNXIAIHQGFZCNFNCLUHBLSKWXHGCTKRQOGWWIELFEYMJGMVKYQTYLBUNAQBNOHHNGKKACXKQFSFTFNCLLUKWWONVBUHBOSHVUDDFZEMAMRQADMBZNMUKADJFGVTYBAATWAPDFLRKKYWESUKUGZCWYMBEKTMYMKCHXJHHIMUUTWLOIUCQYZMLVEYIAHGPYIVFJLACSEOHXHGLZZSRKSQEOXQZSMWDVUCDWWFDBTZIXNWDTXUMXQQCCLFEUWWFZZNXXMXDMMCXYUNLOXHNFNLTIRXRHHFKFUADMVIPEWUQTWGZHMEPSWZSDBJEXWZYLCJIAISVEEOPEFYHHANWKSKZYYHNPGLTYUIYBEVKSAQQWZLHGUMMSTWZQSAPOOEQWWBASBUNNQUCEPCIEOKBTLAQPIUCGGVJQDFJSFEMBEDWJVZKMKAJCFFMUCRHAMMOPXCKNWFHJXVAMZIHJRMUJRHSRHRLJYV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