47 lines
627 B
Plaintext
47 lines
627 B
Plaintext
import extensions;
|
|
|
|
class Point
|
|
{
|
|
int X : prop;
|
|
int Y : prop;
|
|
|
|
constructor new(int x, int y)
|
|
{
|
|
X := x;
|
|
Y := y
|
|
}
|
|
|
|
constructor new()
|
|
<= new(0,0);
|
|
|
|
print() { console.printLine("Point") }
|
|
}
|
|
|
|
class Circle : Point
|
|
{
|
|
int R : prop;
|
|
|
|
constructor new()
|
|
<= new(0);
|
|
|
|
constructor new(int r)
|
|
<= new(0, 0, r);
|
|
|
|
constructor new(int x, int y, int r)
|
|
<= super new(x, y)
|
|
{
|
|
R := r
|
|
}
|
|
|
|
print() { console.printLine("Circle") }
|
|
}
|
|
|
|
public program()
|
|
{
|
|
Point p := Point.new();
|
|
Point c := Circle.new();
|
|
|
|
p.print();
|
|
c.print()
|
|
}
|