讓我們假設有三種模型動物,貓,狗,貓和狗從父類動物繼承。 class Animal:
name
class Cat:
sleep_hours
class Dog:
breed
考慮到sleep_hours和品種分別是貓和狗的互斥屬性。現在我們有串行: - AnimalSerializer:
name
CatSerializer(AnimalSeri
我遇到了這個問題,我不知道如何從第三個類擴展..所以我真的需要用參數'TYPE'調用A類的方法,extend與C,並能夠與類C調用getType()。任何解決方案? const TYPE = 'TYPE'
class A {
constructor(type) {
this.type = type;
}
getTy
我有以下情況: class C {
static void m1() {}
}
interface I {
default void m1() {}
}
//this will give compilation error : inherited method from C cannot hide public abstract method in I
class