Advertisement
Gillito

Untitled

Aug 4th, 2015
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication70
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             HeirClass obj = new HeirClass();
  14.             obj.Show();
  15.         }
  16.     }
  17.  
  18.     class BasicClass
  19.     {
  20.         protected string mystring;
  21.  
  22.         public BasicClass(string somestring)
  23.         {
  24.             mystring = somestring;
  25.         }
  26.  
  27.         public void Show()
  28.         {
  29.             Console.WriteLine(mystring);
  30.         }
  31.     }
  32.  
  33.     class HeirClass : BasicClass
  34.     {
  35.         public HeirClass()
  36.             : base("hello") { }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement