Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- public class Program
- {
- public static void Main ()
- {
- List<string> dinosaurs = new List<string>();
- //new List of type string called 'dinosaurs' equals a new List of type string
- //in other words, instatiate a new list called 'dinosaurs'
- dinosaurs.Add("T-Rex");
- dinosaurs.Add("Raptor");
- dinosaurs.Add("Stegadon");
- foreach(string dinosaur in dinosaurs)
- Console.WriteLine(dinosaur);
- Console.WriteLine("\n---------------------");
- List<string> dogNames = new List<string>() {"Rex", "Buddy"};
- foreach(string dogName in dogNames)
- Console.WriteLine(dogName);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement