【发布时间】:2014-01-14 11:46:06
【问题描述】:
在 Java 中,我可能有一个接口 IsSilly 和一个或多个实现它的具体类型:
public interface IsSilly {
public void makePeopleLaugh();
}
public class Clown implements IsSilly {
@Override
public void makePeopleLaugh() {
// Here is where the magic happens
}
}
public class Comedian implements IsSilly {
@Override
public void makePeopleLaugh() {
// Here is where the magic happens
}
}
Dart 中这段代码的等价物是什么?
在阅读了官方的docs 类之后,Dart 似乎没有原生的interface 类型。那么,一般的 Dartisan 是如何实现接口隔离原理的呢?
【问题讨论】:
标签: oop inheritance dart interface