RosettaCodeData/Task/Classes/Elena/classes.elena

28 lines
375 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
import extensions;
class MyClass
{
2026-02-01 16:33:20 -08:00
int Variable : prop(_variable);
2023-07-01 11:58:00 -04:00
someMethod()
{
2026-02-01 16:33:20 -08:00
_variable := 1
2023-07-01 11:58:00 -04:00
}
constructor()
{
}
}
2026-02-01 16:33:20 -08:00
public Program()
2023-07-01 11:58:00 -04:00
{
// instantiate the class
var instance := new MyClass();
// invoke the method
instance.someMethod();
// get the variable
2025-08-11 18:05:26 -07:00
Console.printLine("Variable=",instance.Variable)
2023-07-01 11:58:00 -04:00
}