
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
What is the Length property of BitArray class in C#?
The length property is used to gets or sets the number of elements in the BitArray.
Our BitArray.
BitArray arr = new BitArray( 5 );
To calculate the length, use the length property.
Console.WriteLine( "Length: {0}", arr.Length );
You can try to run the following code to learn how to work with Length property of BitArray class.
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
- Related Articles
- What is the IsReadOnly property of BitArray class in C#?
- What is the Count property of BitArray class in C#?
- What is the Item property of BitArray class in C#?
- What is the BitArray class in C#?
- BitArray Class in C#
- What is the IsReadOnly property of Hashtable class in C#?
- What is the Item property of ArrayList class in C#?
- What is the Keys property of Hashtable class in C#?
- What is the IsFixedSize property of SortedList class in C#?
- What is the IsReadOnly property of SortedList class in C#?
- What is the IsFixedSize property of Hashtable class in C#?
- What is the Keys property of SortedList class in C#?
- What is the Item property of Hashtable class in C#?
- What is the Item property of SortedList class in C#?
- What is the IsFixedSize property of ArrayList class in C#?

Advertisements