34 lines
539 B
Plaintext
34 lines
539 B
Plaintext
bundle Default {
|
|
class MyClass {
|
|
@var : Int;
|
|
|
|
New() {
|
|
}
|
|
|
|
method : public : SomeMethod() ~ Nil {
|
|
@var := 1;
|
|
}
|
|
|
|
method : public : SetVar(var : Int) ~ Nil {
|
|
@var := var;
|
|
}
|
|
|
|
method : public : GetVar() ~ Int {
|
|
return @var;
|
|
}
|
|
}
|
|
|
|
class Test {
|
|
function : Main(args : String[]) ~ Nil {
|
|
inst := MyClass->New();
|
|
inst->GetVar()->PrintLine();
|
|
|
|
inst->SomeMethod();
|
|
inst->GetVar()->PrintLine();
|
|
|
|
inst->SetVar(15);
|
|
inst->GetVar()->PrintLine();
|
|
}
|
|
}
|
|
}
|