Use the Or() method to perform an OR operation on the elements in BitArray and another BitArray : BitArray « Data Structure « C# / CSharp Tutorial

C# / CSharp Tutorial
1. Language Basics
2. Data Type
3. Operator
4. Statement
5. String
6. struct
7. Class
8. Operator Overload
9. delegate
10. Attribute
11. Data Structure
12. Assembly
13. Date Time
14. Development
15. File Directory Stream
16. Preprocessing Directives
17. Regular Expression
18. Generic
19. Reflection
20. Thread
21. I18N Internationalization
22. GUI Windows Forms
23. 2D
24. Design Patterns
25. Windows
26. XML
27. ADO.Net
28. Network
29. Directory Services
30. Security
31. unsafe
Microsoft Office Word 2007 Tutorial
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
C# / CSharp Tutorial » Data Structure » BitArray 
11. 27. 6. Use the Or() method to perform an OR operation on the elements in BitArray and another BitArray
 
using System;
using System.Collections;

class MainClass
{
  public static void DisplayBitArray(string arrayListName, BitArray myBitArray )
  {
    for (int i = 0; i < myBitArray.Count; i++)
    {
      Console.WriteLine(arrayListName + "[" + i + "] = " + myBitArray[i]);
    }
  }

  public static void Main()
  {
    BitArray myBitArray = new BitArray(4);
    myBitArray[0false;
    myBitArray[1true;
    myBitArray[2true;
    myBitArray[3false;
    DisplayBitArray("myBitArray", myBitArray);

    
    BitArray anotherBitArray = new BitArray(myBitArray);
    DisplayBitArray("anotherBitArray", myBitArray);

    myBitArray.Not();
    DisplayBitArray("myBitArray", myBitArray);

    
    myBitArray.Or(anotherBitArray);
    DisplayBitArray("myBitArray", myBitArray);


  }

}

        
myBitArray[0] = False
myBitArray[1] = True
myBitArray[2] = True
myBitArray[3] = False
anotherBitArray[0] = False
anotherBitArray[1] = True
anotherBitArray[2] = True
anotherBitArray[3] = False
myBitArray[0] = True
myBitArray[1] = False
myBitArray[2] = False
myBitArray[3] = True
myBitArray[0] = True
myBitArray[1] = True
myBitArray[2] = True
myBitArray[3] = True
  
11. 27. BitArray
11. 27. 1. BitArray: Not()
11. 27. 2. BitArray: Xor()
11. 27. 3. Set the four elements of the BitArray and display the elements of the BitArray
11. 27. 4. Use copy constructor in BitArray
11. 27. 5. Use the Not() method to reverse the elements in BitArray
11. 27. 6. Use the Or() method to perform an OR operation on the elements in BitArray and another BitArray
w___w__w_.__j_a__va2s___.__c___o__m_ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.