27 lines
411 B
Vala
27 lines
411 B
Vala
class Base : Object {
|
|
public int field;
|
|
|
|
public Base () {
|
|
field = 5;
|
|
}
|
|
}
|
|
|
|
class Child : Base {
|
|
}
|
|
|
|
void main () {
|
|
var b = new Base ();
|
|
var c = new Child ();
|
|
stdout.printf ("%d\n", c.field);
|
|
|
|
//Error *err;
|
|
//stdout.printf ("%s\n", err->message);
|
|
|
|
string s = "Hello, world!";
|
|
stdout.printf ("%s\n", s[7:s.length]);
|
|
for (var i = 0; s[i] != '\0' ; ++i) {
|
|
stdout.putc (s[i]);
|
|
}
|
|
stdout.putc ('\n');
|
|
}
|