Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
27
Task/Abstract-type/D/abstract-type.d
Normal file
27
Task/Abstract-type/D/abstract-type.d
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import std.stdio;
|
||||
|
||||
class Foo {
|
||||
// abstract methods can have an implementation for
|
||||
// use in super calls.
|
||||
abstract void foo() {
|
||||
writeln("Test");
|
||||
}
|
||||
}
|
||||
|
||||
interface Bar {
|
||||
void bar();
|
||||
|
||||
// Final interface methods are allowed.
|
||||
final int spam() { return 1; }
|
||||
}
|
||||
|
||||
class Baz : Foo, Bar { // Super class must come first.
|
||||
override void foo() {
|
||||
writefln("Meep");
|
||||
super.foo();
|
||||
}
|
||||
|
||||
void bar() {}
|
||||
}
|
||||
|
||||
void main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue