Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- abstract class Shape
- {
- public abstract float Area();
- }
- class Rectangle : Shape
- {
- public float width;
- public float height;
- public override float Area()
- {
- return width * heigth;
- }
- }
- class Circle : Shape
- {
- public float radius;
- public override float Area()
- {
- return radius * radius * Mathf.PI;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement