September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
29
Task/Classes/OoRexx/classes.rexx
Normal file
29
Task/Classes/OoRexx/classes.rexx
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
p = .point~new
|
||||
c = .circle~new
|
||||
|
||||
p~print
|
||||
c~print
|
||||
|
||||
::class point
|
||||
::method init
|
||||
expose x y
|
||||
use strict arg x = 0, y = 0 -- defaults to 0 for any non-specified coordinates
|
||||
|
||||
::attribute x
|
||||
::attribute y
|
||||
|
||||
::method print
|
||||
expose x y
|
||||
say "A point at location ("||x","y")"
|
||||
|
||||
::class circle subclass point
|
||||
::method init
|
||||
expose radius
|
||||
use strict arg x = 0, y = 0, radius = 0
|
||||
self~init:super(x, y) -- call superclass constructor
|
||||
|
||||
::attribute radius
|
||||
|
||||
::method print
|
||||
expose radius
|
||||
say "A circle of radius" radius "centered at location ("||self~x","self~y")"
|
||||
Loading…
Add table
Add a link
Reference in a new issue