BitArray.Clone() Method is used to create a shallow copy of the specified BitArray. A shallow copy of a collection copies only the elements of the collection irrespective of reference types or value types. But it does not copy the objects that the references refer to. The references in the new collection point to the same objects that the references in the original collection point to.
public object Clone ();
Elements of Original BitArray: False False True True Elements of Cloned BitArray: False False True True Reference Equals: False
- C# | How to create a shallow copy of the BitArray
- How to create a shallow copy of Hashtable in C#
- How to create a shallow copy of ArrayList in C#
- How to create a shallow copy of SortedList Object in C#
- Shallow Copy and Deep Copy in C#
- C# | BitArray Class
- C# | Set all bits in the BitArray to the specified value
- C# | Get or set the number of elements in the BitArray
- C# | Inverting all bit values in BitArray
- C# | Set the bit at a specific position in the BitArray to the specified value
- C# | Bitwise AND between the elements of BitArray
- C# | Check if the BitArray is read-only
- C# | Enumerator that iterates through the BitArray
- C# | Get value of the bit at a specific position in BitArray
- BitArray.LeftShift() Method in C# with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.