Created
May 22, 2019 04:29
-
-
Save serdarsen/e0ecf22db87eea71134a4a1f8d0590f7 to your computer and use it in GitHub Desktop.
Inheritance Sample of Vala - Calling base class constructure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The code below can be run and test in https://tio.run/#vala | |
public class Vehicle | |
{ | |
public Vehicle(string text) | |
{ | |
print("Vehicle %s", text); | |
} | |
} | |
public class Car : Vehicle | |
{ | |
public Car(string text) | |
{ | |
base(text); | |
} | |
} | |
public static int main(string[] args) | |
{ | |
var car = new Car("test1"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment