langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
31
Task/Classes/NetRexx/classes.netrexx
Normal file
31
Task/Classes/NetRexx/classes.netrexx
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
class ClassExample
|
||||
|
||||
properties private -- class scope
|
||||
foo = int
|
||||
|
||||
properties public -- publicly visible
|
||||
bar = boolean
|
||||
|
||||
properties indirect -- generates bean patterns
|
||||
baz = String()
|
||||
|
||||
method main(args=String[]) static -- main method
|
||||
clsex = ClassExample() -- instantiate
|
||||
clsex.foo = 42
|
||||
clsex.baz = 'forty-two'
|
||||
clsex.bar = 0 -- boolean false
|
||||
clsex.test(clsex.foo)
|
||||
clsex.test(clsex.bar)
|
||||
clsex.test(clsex.baz)
|
||||
|
||||
method test(s=int)
|
||||
aap = 1 -- local (stack) variable
|
||||
say s aap
|
||||
|
||||
method test(s=String)
|
||||
noot = 2
|
||||
say s noot
|
||||
|
||||
method test(s=boolean)
|
||||
mies = 3
|
||||
say s mies
|
||||
Loading…
Add table
Add a link
Reference in a new issue