Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
38
Task/Polymorphism/Oz/polymorphism.oz
Normal file
38
Task/Polymorphism/Oz/polymorphism.oz
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
class Point
|
||||
feat
|
||||
x
|
||||
y
|
||||
|
||||
meth init(x:X<=0.0 y:Y<=0.0)
|
||||
self.x = X
|
||||
self.y = Y
|
||||
end
|
||||
|
||||
meth print
|
||||
{System.showInfo
|
||||
"Point("#
|
||||
"x:"#self.x#
|
||||
", y:"#self.y#
|
||||
")"}
|
||||
end
|
||||
end
|
||||
|
||||
class Circle
|
||||
feat
|
||||
center
|
||||
r
|
||||
|
||||
meth init(center:C<={New Point init} r:R<=1.0)
|
||||
self.center = C
|
||||
self.r = R
|
||||
end
|
||||
|
||||
meth print
|
||||
{System.showInfo
|
||||
"Circle("#
|
||||
"x:"#self.center.x#
|
||||
", y:"#self.center.y#
|
||||
", r:"#self.r#
|
||||
")"}
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue