1
// Copyright (C) 2010 Sepehr Aryani
2
// Email: Sepehr.aryani@gmail.com
3
// Author : Sepehr Aryani (Sepidev)
6
This file is part of Vala-Tutorials.
8
Vala-Tutorials is free software: you can redistribute it and/or modify
9
it under the terms of the GNU Lesser General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
13
Vala-Tutorials is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU Lesser General Public License for more details.
18
You should have received a copy of the GNU Lesser General Public License
19
along with Vala-Tutorials. If not, see <http://www.gnu.org/licenses/>.
23
* an abstract class that is acts as a base class
26
public abstract class Animal : Object{
43
* abstract function, has no implementaion yet.
44
* can be overrided by subclasses.
46
public abstract void say_hello();
49
* virtual function can be overrided by sub classes.
51
public virtual void say_bye(){
56
public class Lion : Animal{
73
* actual implementaion.
75
public override void say_hello(){
76
print("hi, my name is Lion\n");
82
public override void say_bye(){
84
print("HAAAAAAAAAAAAAAAA....\n");
88
public class Eagle : Animal{
105
* actual implementaion.
107
public override void say_hello(){
108
print("hi, my name is Eagle\n");
112
* overrided function.
114
public override void say_bye(){
115
print("GHAAAAAAAAAAAAAA....");
121
public class Cow : Animal{
138
* actual implementaion.
140
public override void say_hello(){
141
print("hi, my name is Cow\n");
145
* overrided function.
147
public override void say_bye(){
148
print("MOOOOOOOOOOOO....\n");
152
public class Wolf : Animal{
169
* actual implementaion.
171
public override void say_hello(){
172
print("hi, my name is Wolf\n");
176
* overrided function.
178
public override void say_bye(){
179
print("WHOOOOOOOOOOOOOOOO....\n");