diff options
-rwxr-xr-x | vala.html.markdown | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/vala.html.markdown b/vala.html.markdown index 6e1a215f..923b152e 100755 --- a/vala.html.markdown +++ b/vala.html.markdown @@ -255,13 +255,8 @@ class Message : GLib.Object { // Class Message extends GLib's Object } -interface Laptop { // May only contain abstract methods - public abstract void turn_on(); - public abstract void turn_off(); -} - -// Since method overloading isn't possible, you can use named constructors -// to get the same functionality. +// Since method overloading isn't possible, you can't overload constructors. +// However, you can use named constructors to achieve the same functionality. public class Calculator : GLib.Object { @@ -383,6 +378,14 @@ public class MyHD : HardDrive { } } +// Interfaces: classes can implement any number of these. + +interface Laptop { // May only contain abstract methods + public abstract void turn_on(); + public abstract void turn_off(); +} + + ``` * More Vala documentation can be found [here](https://valadoc.org/). * Read about building GUIs with GTK+ and Vala [here](http://archive.is/7C7bw). |