RosettaCodeData/Task/Classes/Elena/classes.elena

28 lines
361 B
Text
Raw Permalink Normal View History

2019-09-12 10:33:56 -07:00
import extensions;
2016-12-05 22:15:40 +01:00
2017-09-23 10:01:46 +02:00
class MyClass
2016-12-05 22:15:40 +01:00
{
2019-09-12 10:33:56 -07:00
prop int Variable;
2016-12-05 22:15:40 +01:00
2019-09-12 10:33:56 -07:00
someMethod()
{
Variable := 1
}
2016-12-05 22:15:40 +01:00
2019-09-12 10:33:56 -07:00
constructor()
{
}
2016-12-05 22:15:40 +01:00
}
2019-09-12 10:33:56 -07:00
public program()
{
2016-12-05 22:15:40 +01:00
// instantiate the class
2019-09-12 10:33:56 -07:00
var instance := new MyClass();
2016-12-05 22:15:40 +01:00
// invoke the method
2019-09-12 10:33:56 -07:00
instance.someMethod();
2016-12-05 22:15:40 +01:00
// get the variable
2019-09-12 10:33:56 -07:00
console.printLine("Variable=",instance.Variable)
}