dev/vala/abstract_class/abstract_class.vala

23 lines
386 B
Vala

public abstract class Animal : Object {
public void eat() {
stdout.printf("*chomp chomp*\n");
}
public abstract void say_hello();
}
public class Tiger : Animal {
public override void say_hello() {
stdout.printf("*roar*\n");
}
}
/*public class Duck : Animal {
public override void say_hello() {
stdout.printf("*quack*\n");
}
}*/