RosettaCodeData/Task/Classes/Sather/classes-2.sa

13 lines
388 B
Plaintext

class MAIN is
main is
test ::= #CLASSTEST(1, 2, 3);
-- the previous line is syntactic sugar for
-- test :CLASSTEST := CLASSTEST::create(1, 2, 3);
#OUT + test.z + "\n"; -- we can access z
test.z := 25; -- we can set z
#OUT + test.x + "\n"; -- we can get x
-- test.x := 5; -- we cannot set x
#OUT + test.getPrivateY(0) + "\n";
end;
end;