Created
February 25, 2021 15:28
-
-
Save guid-empty/175ea9236fd3cd5f7827831568566f47 to your computer and use it in GitHub Desktop.
Dart.Language.Classes & Implementation the interfaces
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
final entity = Entity(); | |
print(entity is Disposable); | |
print(entity is Clonable); | |
print(entity is Comparable); | |
print(entity is BaseEntity); | |
// entity. | |
} | |
abstract class Clonable { | |
dynamic clone(); | |
} | |
abstract class Disposable { | |
void dispose(); | |
} | |
abstract class Comparable { | |
int compare(); | |
} | |
abstract class BaseEntity { | |
int get id; | |
} | |
class Entity extends BaseEntity implements Clonable, Disposable, Comparable { | |
@override | |
clone() { | |
throw UnimplementedError(); | |
} | |
@override | |
int compare() { | |
throw UnimplementedError(); | |
} | |
@override | |
void dispose() {} | |
@override | |
int get id => throw UnimplementedError(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment