猿问

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

chrome1121
浏览 1806回答 1
1回答

莫名所以

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

慕瓜9220888

BAVKGPVUVHIXLEIREAEVTSHQZQGCMLJYEAGQWKQSUDTCFWTCKCSHUXUVGYDJMRETUTOMMYHBMVNSQQTCVQDVNEKTPMABZHONNJJOLTMUBRSCKVDWVLUQAHIGBQJIIYFJRTRHXGGTUUSRKTAKNXWUSRNTWSGEGEUTTTTDSGIFRKCSXCKISHBEJUSKJHQQCMKKSUUTMWEVNLKAJMGICLZPSCRVWHWYRWDQAMDCOXHCQKCXZIOXUBCTOJIRDKHUCXSINKXLOTOQMBDQNXQIEZFMZMWYJVLQXKRBALAWCMVSFNBATSSCTNDYNDIVMMQGJFAPDADNFLRDWPRLRVACHXANEOKSXSHYLYMMXTCIROCWBTFKZTWQUOTIYNAYVWOIYTISWPZWGIQFZMPAYFBPBODJKAUMBWFCLLMKSAZIRRHEIUCUEKMEVCAZXAQBOGALKHQTSSULASUTTWTXOAASCIKNXIAIHQGFZCNFNCLUHBLSKWXHGCTKRQOGWWIELFEYMJGMVKYQTYLBUNAQBNOHHNGKKACXKQFSFTFNCLLUKWWONVBUHBOSHVUDDFZEMAMRQADMBZNMUKADJFGVTYBAATWAPDFLRKKYWESUKUGZCWYMBEKTMYMKCHXJHHIMUUTWLOIUCQYZMLVEYIAHGPYIVFJLACSEOHXHGLZZSRKSQEOXQZSMWDVUCDWWFDBTZIXNWDTXUMXQQCCLFEUWWFZZNXXMXDMMCXYUNLOXHNFNLTIRXRHHFKFUADMVIPEWUQTWGZHMEPSWZSDBJEXWZYLCJIAISVEEOPEFYHHANWKSKZYYHNPGLTYUIYBEVKSAQQWZLHGUMMSTWZQSAPOOEQWWBASBUNNQUCEPCIEOKBTLAQPIUCGGVJQDFJSFEMBEDWJVZKMKAJCFFMUCRHAMMOPXCKNWFHJXVAMZIHJRMUJRHSRHRLJYVEYKXVWVTAZJIVFTSDCSD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