Advertisement
karlakmkj

Generic collections - List

Nov 27th, 2020
422
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace LearnLists
  5. {
  6.   class Program
  7.   {
  8.     static void Main()
  9.     {
  10.       /* Declare three empty lists:
  11.        1. hold bool types
  12.        2. hold Random types
  13.        3. hold IServiceProvider types
  14.       */
  15.        
  16.       List<bool> yesno = new List<bool>();
  17.       List<Random> rand = new List<Random>();
  18.       List <IServiceProvider> sp = new List<IServiceProvider>();  //interfaces also work here!
  19.     }
  20.   }
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement