Advertisement
Gillito

Untitled

Aug 4th, 2015
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.82 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(15);
  14.             obj.Show();
  15.         }
  16.     }
  17.  
  18.     class BasicClass
  19.     {
  20.         protected string mystring;
  21.         protected int somevalue;
  22.  
  23.         public BasicClass(string somestring, int val)
  24.         {
  25.             mystring = somestring;
  26.             somevalue = val;
  27.         }
  28.  
  29.         public void Show()
  30.         {
  31.             Console.WriteLine(mystring);
  32.             Console.WriteLine(somevalue);
  33.         }
  34.     }
  35.  
  36.     class HeirClass : BasicClass
  37.     {
  38.         public HeirClass(int val)
  39.             : base("Hello", val) { }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement