Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 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 OOP_dag_3.sidste_opgave
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Queue<Car> garage = new Queue<Car>();
  14.  
  15.             Car myFord = new Car("Ford");
  16.             Car myBMW = new Car("BMW");
  17.             Car myTesla = new Car("Tesla");
  18.  
  19.            garage.Enqueue(myFord);
  20.            garage.Enqueue(myBMW);
  21.            garage.Enqueue(myTesla);
  22.  
  23.  
  24.  
  25.            foreach (Car obj in garage)
  26.             {
  27.                Console.WriteLine(obj);
  28.             }
  29.            
  30.            
  31.             Console.ReadLine();
  32.  
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement