Advertisement
wingman007

OOP_2015_Program

Mar 17th, 2015
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.26 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 Person1a
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int i = 0;
  14.             Person person1 = new Person("Stoyan", 50);
  15.             i++;
  16.             Person person2 = new Person();
  17.             i++;
  18.             Person person3 = new Person(20, "Rayna");
  19.             i++;
  20.  
  21.             // person1.Name = "Stoyan";
  22.             // person1.Age = 50;
  23.  
  24.             // person2.Name = "Rayna";
  25.             // person2.Age = 20;
  26.             /*
  27.             Console.WriteLine("My name is {0}. I am {1} old.",
  28.                 person1.Name, person1.Age);
  29.  
  30.             Console.WriteLine("My name is {0}. I am {1} old.",
  31.                 person2.Name, person2.Age);
  32.  
  33.             Console.WriteLine("My name is {0}. I am {1} old.",
  34.                 person3.Name, person3.Age);
  35.             */
  36.  
  37.             Person.nationality = "German";
  38.  
  39.             person1.IntroduceYourSelf();
  40.             person2.IntroduceYourSelf();
  41.             person3.IntroduceYourSelf();
  42.  
  43.             System.Console.WriteLine(Person.counter);
  44.            
  45.  
  46.             Console.WriteLine("Hello World");
  47.         }
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement