Abstract type: Difference between revisions
Content deleted Content added
Line 1,551:
<lang Oforth>Property new: Spherical(r)
Spherical method: radius
Spherical method: setRadius
Spherical method: perimeter
Spherical method: surface
Object Class new: Ballon(color)
Ballon is: Spherical
Ballon method: initialize(color, r)
Object Class new: Planete(name)
Planete is: Spherical
Planete method: initialize(n, r)
Usage :
<lang Oforth>
| b p |
Ballon new($red, 0.1) ->b
Line 1,576 ⟶ 1,575:
System.Out "Earth radius is : " << p radius << cr
System.Out "Earth perimeter is : " << p perimeter << cr
System.Out "Earth surface is : " << p surface << cr ;</lang>
{{out}}
|