|
|
Line 719: |
Line 719: |
|
} |
|
} |
|
|
|
|
|
==[[C sharp|C# TODO]]== |
|
==[[C sharp|C#]]== |
|
[[Category:C sharp]] |
|
[[Category:C sharp]] |
|
|
|
|
|
using System; |
|
using System; |
|
|
|
|
|
class Point |
|
class Point |
|
{ |
|
|
protected int x, y; |
|
⚫ |
public Point() { this(0) ; } |
|
⚫ |
public Point(int x0) : this(x0,0) { } |
|
⚫ |
public Point(int x0, int y0) { x = x0; y = y0; } |
|
⚫ |
public int getX() { return x; } |
|
⚫ |
public int getY() { return y; } |
|
⚫ |
public int setX(int x0) { x = x0; } |
|
⚫ |
public int setY(int y0) { y = y0; } |
|
⚫ |
public void print() { System.Console.WriteLine("Point"); } |
|
|
} |
|
⚫ |
public class Circle : Point |
|
|
{ |
|
⚫ |
|
|
⚫ |
public Circle(Point p) : this(p,0) { } |
|
⚫ |
public Circle(Point p, int r0) : base(p) { r = r0; } |
|
⚫ |
public Circle() : this(0) { } |
|
⚫ |
public Circle(int x0) : this(x0,0) { } |
|
⚫ |
public Circle(int x0, int y0) : this(x0,y0 ,0) { } |
|
|
public Circle(int x0, int y0, int r0) : base(x0,y0) { r = r0; } |
|
⚫ |
public int getR() { return r; } |
|
|
public int setR(int r0) { r = r0; } |
|
⚫ |
public override void print() { System.Console.WriteLine("Circle"); } |
|
⚫ |
public static void main(String args[]) |
|
|
{ |
|
{ |
|
Point p = new Point(); |
|
protected int x, y; |
|
Point c = new Circle(); |
|
public Point() { this(0); } |
|
⚫ |
public Point(int x0) : this(x0,0) { } |
⚫ |
|
|
|
c.print(); |
|
public Point(int x0, int y0) { x = x0; y = y0; } |
|
⚫ |
public int getX() { return x; } |
|
⚫ |
public int getY() { return y; } |
|
⚫ |
public int setX(int x0) { x = x0; } |
|
⚫ |
public int setY(int y0) { y = y0; } |
|
⚫ |
public void print() { System.Console.WriteLine("Point"); } |
|
|
} |
|
|
|
|
⚫ |
public class Circle : Point |
|
|
{ |
|
⚫ |
|
|
⚫ |
public Circle(Point p) : this(p,0) { } |
|
⚫ |
public Circle(Point p, int r0) : base(p) { r = r0; } |
|
⚫ |
public Circle() : this(0) { } |
|
⚫ |
public Circle( int x0) : this( x0,0) { } |
|
⚫ |
public Circle(int x0 , int y0) : this(x0 ,y0,0) { } |
|
⚫ |
public Circle(int x0, int y0 , int r0) : base(x0,y0) { r = r0; } |
|
⚫ |
public int getR() { return r; } |
|
⚫ |
public int setR(int r0) { r = r0; } |
|
⚫ |
public override void print() { System.Console.WriteLine("Circle"); } |
|
|
|
|
⚫ |
public static void main(String args[]) |
|
|
{ |
|
|
Point p = new Point(); |
|
|
Point c = new Circle(); |
|
⚫ |
|
|
|
c.print(); |
|
|
} |
|
} |
|
} |
|
} |
|
|
|
|
|
|
==[[D|D TODO]]== |
|
==[[D|D TODO]]== |