Advertisement
wingman007

C#_OOP_Abstraction_Encapsulation_Polymorphism_Program.cs

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