In Java, I might have an interface IsSilly
and one or more concrete types that implement it:
public interfa
The confusion usually is because doesn't exist the word "interface" like java and another languages. Class declarations are themselves interfaces in Dart.
In Dart every class defines an implicit interface like others says.So then... the key is: Classes should use the implements keyword to be able to use an interface.
abstract class IsSilly {
void makePeopleLaugh();
}
//Abstract class
class Clown extends IsSilly {
void makePeopleLaugh() {
// Here is where the magic happens
}
}
//Interface
class Comedian implements IsSilly {
void makePeopleLaugh() {
// Here is where the magic happens
}
}