我是靠谱客的博主 丰富小蘑菇,这篇文章主要介绍implements,现在分享给大家,希望可以做个参考。

implements:是实现类接口的关键字

接口的是做什么?

interface 就是对参数,函数,数组,类的限制

例子:函数t里面参数arg:test要按照test 的规格来,没有就会报错

复制代码
1
2
3
4
5
interface test{ name:string } funcrtion t(agr:test){ }

例子:限制类的写法 就会用到 implements

复制代码
1
2
3
4
5
6
interface test{ name:string; go(str:string):void } class newTest implements test{ // 里面就必须要有 test 设定的参数和方法 }

 

最后

以上就是丰富小蘑菇最近收集整理的关于implements的全部内容,更多相关implements内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(89)

评论列表共有 0 条评论

立即
投稿
返回
顶部