实现接口 这段的实例出错
来源:3-12 接口 -类类型+继承接口+混合类型+接口继承类

wlxz
2019-12-08
interface ClockInterface {
currentTime: Date
}
class Clock implements ClockInterface {
currentTime: Date
constructor(h: number, m: number) { }
}
写回答
1回答
-
提示写的很清楚了,currentTime 没有初始化,需要在构造函数中初始化。
032019-12-10
相似问题
关于接口继承类的疑问
回答 1
接口和类的实现
回答 1