test-007.vala 373 Bytes
Newer Older
1 2
using GLib;

3
class Maman.Bar : Object {
4 5
	public virtual void do_action () {
		stdout.printf (" BAD");
6
	}
7 8 9 10 11 12 13
}

class Maman.SubBar : Bar {
	public override void do_action () {
		stdout.printf (" 2");
	}

14
	static int main (string[] args) {
15 16 17 18
		stdout.printf ("Virtual Method Test: 1");

		Bar bar = new SubBar ();
		bar.do_action ();
19
	
20 21 22
		stdout.printf (" 3\n");

		return 0;
23 24
	}
}