Abstract type: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 413: | Line 413: | ||
class Foo { |
class Foo { |
||
// abstract methods can have an implementation for |
// abstract methods can have an implementation for |
||
// use in super calls |
// use in super calls. |
||
abstract void foo() { |
abstract void foo() { |
||
writeln("Test"); |
writeln("Test"); |
||
Line 420: | Line 420: | ||
interface Bar { |
interface Bar { |
||
⚫ | |||
// provide default implementations |
|||
void bar(); |
void bar(); |
||
⚫ | |||
final int spam() { return 1; } |
|||
} |
} |
||
class Baz : Foo, Bar { // |
class Baz : Foo, Bar { // Super class must come first. |
||
override void foo() { |
override void foo() { |
||
writefln("Meep"); |
writefln("Meep"); |