dev/vala/hello/interfaces.vala

24 lines
582 B
Vala
Raw Normal View History

2012-09-30 19:46:05 +04:00
interface IfaceA : Object {
public abstract void method_a ();
}
interface IfaceB : Object, IfaceA {
public abstract void method_b ();
}
class Demo : Object, IfaceA, IfaceB {
public void method_a () { stdout.printf ("a called\n"); }
public void method_b () { stdout.printf ("b called\n"); }
public void method_c () { stdout.printf ("c called\n"); }
static int main ()
{
stdout.printf ("Hello world!\n");
var demo = new Demo ();
demo.method_a ();
demo.method_b ();
demo.method_c ();
return 0;
}
}