1
飛鏢代碼:無法訪問Dart中父類的靜態變量?
main() {
print(PPP.name);
print(CCC.name);
}
class PPP {
static String name = "PPP";
}
class CCC extends PPP {
}
它打印:
PPP
Unhandled exception:
No static getter 'name' declared in class 'CCC'.
NoSuchMethodError : method not found: 'name'
Receiver: Type: class 'CCC'
Arguments: [...]
所以它無法訪問父類的靜態變量在DART?