是“界面”吗?关键字已从Dart中删除? [英] Was the "interface" keyword removed from Dart?

查看:79
本文介绍了是“界面”吗?关键字已从Dart中删除?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以肯定的是,Dart是否已删除显式定义接口的位置,现在支持通过隐式定义它抽象

Just to be sure, has Dart removed explicitly defining an interface now in favor of implicitly defining it via abstract?

我在 Dart和接口隔离原则,但是我也发现很多内容仍在引用显式定义,例如何时在Dart中使用界面?

I see it mentioned in Dart and Interface Segregation Principle, however I'm also finding a lot of content still referencing the explicit definition, such as When to use interfaces in Dart?

推荐答案

是。 interface关键字已从Dart中删除。相反,所有类都具有隐式接口。因此,如果要定义接口,则可以使用抽象类。

Yes. The interface keyword was removed from Dart. Instead all classes have implicit interfaces. So if you want to define an interface you can use an abstract class instead.

请参阅此 2012年以来的博客文章,内容是关于消除interface关键字的信息。

See this blog post from 2012 about eliminating the interface keyword.

这篇关于是“界面”吗?关键字已从Dart中删除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆