- using System;
- using System.Collections.Generic;
- namespace forgetCode
- {
- class program
- {
- public static void Main()
- {
- List<int> list = new List<int>();
- list.Add(1);
- list.Add(2);
- list.Add(3);
- //Before clearing
- Console.WriteLine("Before clearing: "+list.Count);
- list.Clear();
- //After clearing
- Console.WriteLine("After clearing: "+list.Count);
- }
- }
- }