当前位置:网站首页>typescript的class结合接口(interface)的简单使用
typescript的class结合接口(interface)的简单使用
2022-06-26 06:13:00 【前端一枚】
1、接口间继承extends
2、类结合接口使用implements
interface Radio{
switchRadio(trigger:boolean):void
}
interface Battery{
checkBatteryStatus():void
}
//接口继承extends
interface RadioWithBattery extends Radio{
checkBatteryStatus():void
}
//接口接合类implements
class Cellphone implements Radio{
switchRadio(trigger:boolean){}
}
//接口接合类implements
class Cellphone2 implements RadioWithBattery{
switchRadio(trigger:boolean){}
checkBatteryStatus(){}
}
边栏推荐
- "= =" difference from "equals"
- Transaction and message semantics
- SQL server functions
- numpy. exp()
- Mongodb -- use mongodb to intercept the string content in the field and perform grouping statistics
- 在web页面播放rtsp流视频(webrtc)
- 自顶向下的变成方法
- 低代码实时数仓构建系统的设计与实践
- TCP connection and disconnection, detailed explanation of state transition diagram
- Mysql-10 (key)
猜你喜欢
Efk upgrade to Clickhouse log storage practice
Pychart cannot run designer Exe (this application failed to start because no Qt platform plugin could be I appears)
Connexion et déconnexion TCP, détails du diagramme de migration de l'état
Solve the problem that Cmdr cannot use find command under win10
Logstash——Logstash向Email发送告警邮件
技术Leader的思考技巧
Logstash - logstash sends an alarm email to email
TCP连接与断开,状态迁移图详解
消息队列-功能、性能、运维对比
低代码实时数仓构建系统的设计与实践
随机推荐
How to select and build a real-time data warehouse scheme
zip(*arg)的用法
GoF23—工厂模式
TCP連接與斷開,狀態遷移圖詳解
事务与消息语义
ByteDance starts the employee's sudden wealth plan and buys back options with a large amount of money. Some people can earn up to 175%
消息队列-功能、性能、运维对比
Tortoise and rabbit race example
Keepalived to achieve high service availability
01 golang and matlab code of knapsack problem
Thinking skills of technical leaders
Redis多线程与ACL
MySQL-05
MySQL-06
SSH keygen specifies the path
tf. nn. top_ k()
个人博客系统需求分析
Transformer中的Self-Attention以及Multi-Head Self-Attention(MSA)
Cython入门
Matching environment of ES6