Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,27 @@
|
|||
class MyClass
|
||||
declare static id = 5
|
||||
declare MyName
|
||||
|
||||
// constructor
|
||||
def MyClass(MyName)
|
||||
this.MyName = MyName
|
||||
end
|
||||
|
||||
// class method
|
||||
def getName()
|
||||
return this.MyName
|
||||
end
|
||||
|
||||
// static method
|
||||
def static getID()
|
||||
return id
|
||||
end
|
||||
end
|
||||
|
||||
// call the static method
|
||||
println MyClass.getID()
|
||||
|
||||
// instantiate a new MyClass object with the name "test"
|
||||
// and call the class method
|
||||
myclass = new(MyClass, "test")
|
||||
println myclass.getName()
|
||||
Loading…
Add table
Add a link
Reference in a new issue