Initialization of other types of collections in C#
Forums:
//List of Double
var doubleList = new List<Double> { 41.13, 2, 37.5 };
//Stack of string
var stringStack = new Stack<string>();
stringStack.Push("one");
stringStack.Push("two");
//Queue of Employee
var employeeQueue = new Queue<Employee>();
employeeQueue.Enqueue(new Employee("Pavlov", "Anton"));
- Log in to post comments