Advertisement
wingman007

2018TreeProgramClassObjectStatic

Apr 18th, 2018
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 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 Forest
  8. {
  9.   class Program
  10.   {
  11.     static void Main(string[] args)
  12.     {
  13.       Tree oak = new Tree("Oak", 2.3, 7.2);
  14.       Tree pain = new Tree("Pain", 3.4, 1.2);
  15.       Tree tree2 = new Tree("Yasen", 1.2, 3.4);
  16.  
  17.       oak.Introduce();
  18.       pain.Introduce();
  19.       tree2.Introduce();
  20.  
  21.       Tree.Color = "Yellow";
  22.  
  23.       oak.Introduce();
  24.       pain.Introduce();
  25.       tree2.Introduce();
  26.  
  27.       Console.WriteLine("The number of the trees in the forest is {0}", Tree.Counter);
  28.     }
  29.   }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement