Skip to content

Instantly share code, notes, and snippets.

@serdarsen
Created May 22, 2019 04:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save serdarsen/e0ecf22db87eea71134a4a1f8d0590f7 to your computer and use it in GitHub Desktop.
Save serdarsen/e0ecf22db87eea71134a4a1f8d0590f7 to your computer and use it in GitHub Desktop.
Inheritance Sample of Vala - Calling base class constructure
// 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