Length Property का उपयोग BitArray में Elements की संख्या Get या Set करने के लिए किया जाता है।
हमारा BitArray:
BitArray arr = new BitArray(5);
Length Calculate करने के लिए, Length Property का उपयोग करें।
Console.WriteLine("Length: {0}", arr.Length);BitArray Class की Length Property के साथ काम करना सीखने के लिए निम्न Code को Run करें।
Example
using System; using System.Collections; public class Demo { public static void Main() { BitArray arr = new BitArray(5); Console.WriteLine("Count: {0}", arr.Count); Console.WriteLine("Length: {0}", arr.Length); } }Output
Count: 5 Length: 5