C# program List Count






using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class Program
{
    static void Main()
    {
List<bool> list = new List<bool>();
list.Add(true);
list.Add(false);
list.Add(true);
Console.WriteLine(list.Count); // 3

list.Clear();
Console.WriteLine(list.Count); // 0
    Console.ReadLine();
    }
}


Output :



     

Previous Post Next Post