当前位置:网站首页>Simple use of typescript's class interface
Simple use of typescript's class interface
2022-06-26 06:23:00 【One at the front】
1、 Interface inheritance extends
2、 Class is used in conjunction with interfaces implements
interface Radio{
switchRadio(trigger:boolean):void
}
interface Battery{
checkBatteryStatus():void
}
// Interface inheritance extends
interface RadioWithBattery extends Radio{
checkBatteryStatus():void
}
// Interface join class implements
class Cellphone implements Radio{
switchRadio(trigger:boolean){}
}
// Interface join class implements
class Cellphone2 implements RadioWithBattery{
switchRadio(trigger:boolean){}
checkBatteryStatus(){}
} 边栏推荐
- 消息队列-消息事务管理对比
- Go语言学习笔记 1.2-变量篇
- 工作积累——Web请求中使用ThreadLocal遇见的问题
- Volatile application scenarios
- Self attention and multi head self attention (MSA) in transformer
- Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could
- 架构设计方法
- 如何让主线程等待子线程执行完毕后再执行
- Logstash——Logstash向Email发送告警邮件
- [alluxio & Dachang] the original boss direct employment was applied in this way
猜你喜欢

MySQL-08

GoF23—原型模式

GoF23—工厂模式
Everything is a vector. The service practice of iqiyi online vector recall project

连接数服务器数据库报:错误号码2003Can‘t connect to MySQL server on ‘服务器地址‘(10061)

在web页面播放rtsp流视频(webrtc)

数据可视化实战:实验报告
Experience the new features of Milvus 2.0 together

Jasminum plug-in of Zotero document management tool

EFK升级到ClickHouse的日志存储实战
随机推荐
Go语言学习笔记 1.2-变量篇
EFK升级到ClickHouse的日志存储实战
Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could
Understanding of nil in go language
Gof23 - factory mode
typescript的class结合接口(interface)的简单使用
Gof23 - prototype mode
去哪儿网BI平台建设演进史
Unsatisfied dependency expressed through field ‘baseMapper‘; nested exceptio
技术能力的思考和总结
浏览器的四大内核:Trident,Gecko,Webkit,Blink
Thinking skills of technical leaders
A tragedy triggered by "yyyy MM DD" and vigilance before New Year's Day~
温度报警器
How to design a good technical scheme
Unsatisfied dependency expressed through field ‘baseMapper‘; nested exceptio
Zotero文献管理工具之Jasminum(茉莉花)插件
MySQL-09
获取当前月份的第一天和最后一天,上个月的第一天和最后一天
API and encapsulation of cookies