Advertisement
wingman007

2018_OOP_Program_Static_Elements

Apr 12th, 2018
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.52 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 WorldMI
  8. {
  9.   class Program
  10.   {
  11.     static void Main(string[] args)
  12.     {
  13.       Console.WriteLine("National Income {0}", Person.CalculateNationalIncome());
  14.       Console.WriteLine("const PI = {0}", Person.PI);
  15.       //int counter = 0;
  16.       //counter++;
  17.       Person stoyan = new Person("Stoyan", 54, 345.67M, "Koce", "Ralica", "Ivancho");
  18.       //stoyan.Name = "Stoyan";
  19.       //stoyan.Age = -700;
  20.  
  21.       //counter++;
  22.       Person koce = new Person(age: 18, name: "Koce"); // named arguments mus appear after all fixed arguments
  23.       //koce.Name = "Koce";
  24.       //koce.Age = 18;
  25.  
  26.       //Console.WriteLine("My name is {0}. I am {1} years old!", stoyan.Name, stoyan.Age);
  27.  
  28.       //Console.WriteLine("My name is {0}. I am {1} years old!", koce.Name, koce.Age);
  29.  
  30.       stoyan.IntroduceYourSelf();
  31.       koce.IntroduceYourSelf();
  32.  
  33.       Console.WriteLine("The first friend of Stoyan is {0}", stoyan[0]);
  34.  
  35.       DoSomethignElse();
  36.       // Person.counter = 5000;
  37.       Console.WriteLine("The population of my little kingdom is {0}", Person.Counter);
  38.  
  39.       Person plamen = new Person(18, "Plamen");
  40.  
  41.       // stoyan.only4Read = 1000;
  42.       Console.WriteLine("only4Read = {0}", Person.only4Read);
  43.  
  44.       Console.WriteLine("National Income {0}", Person.CalculateNationalIncome());
  45.  
  46.     }
  47.  
  48.     static void DoSomethignElse()
  49.     {
  50.       Person gabi = new Person("Gabi", 18);
  51.     }
  52.   }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement