Advertisement
wingman007

C#_OOP_Inheritance_Program.cs

May 1st, 2014
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.81 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 App1
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.WriteLine(Human.PI);
  14.             Console.WriteLine(Human.onlyRead);
  15.  
  16.            // int counter = 0;
  17.             Human person1 = new Human("Stoyan", 50);
  18.             // counter++;
  19.             // Console.WriteLine(person1.onlyRead);
  20.             Human person2 = new Human(20, "Ivan", "John", "Bruce");
  21.             // counter++;
  22.             Human person3 = new Human();
  23.             // counter++;
  24.  
  25.             // Console.WriteLine("My name is {0}. I am {1} yers old.", person1.Name, person1.Age);
  26.             // Console.WriteLine("My name is {0}. I am {1} yers old.", person2.Name, person2.Age);
  27.  
  28.             Human.Nationality = "German";
  29.  
  30.             person1.IntroduceYoutSelf("verbous");
  31.             person2.IntroduceYoutSelf();
  32.             Console.WriteLine("My friend is {0}.", person2.GetFriend(0));
  33.             person3.IntroduceYoutSelf();
  34.  
  35.             IncreasePopulation();
  36.  
  37.             Student student1 = new Student("Kirsten", 25, 2345);
  38.             Athlete athlete1 = new Athlete("Christian", 26, "futbol");
  39.  
  40.             student1.IntroduceYoutSelf();
  41.             athlete1.IntroduceYoutSelf();
  42.  
  43.             Executor exec1 = new Executor(student1);
  44.             exec1.MakeHimSpeak();
  45.  
  46.  
  47.             Console.WriteLine("The population {0}", Human.counter);
  48.  
  49.             Console.WriteLine("The National Income is {0}", Human.CalculateNationalIncome());
  50.  
  51.             Console.WriteLine("Hello World!");
  52.             Console.Read();
  53.         }
  54.  
  55.         public static void IncreasePopulation()
  56.         {
  57.             Human person1 = new Human("Bruce", 15);
  58.         }
  59.     }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement