Advertisement
Guest User

Untitled

a guest
Nov 10th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.37 KB | None | 0 0
  1. using System;
  2. class MainClass {
  3.   public static void Main (string[] args) {
  4.     Shape TriangleAsShape = new Triangle();
  5.     TriangleAsShape.draw();
  6.   }
  7. }
  8.  
  9. class Shape {
  10.   public void draw() {
  11.     Console.WriteLine ("General shape has been drawn");
  12.   }
  13. }
  14.  
  15. class Triangle : Shape {
  16.   public void draw() {
  17.     Console.WriteLine ("Triangle has been drawn");
  18.   }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement