What is the BitArray class?

Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.

What is the BitArray class?

Rating:

The BitArray class manages a compact array of bit values. The values of the array are represented as booleans, where true indicates that the bit is on one (1), and false indicates that the bit is on zero (0).

The following code snippet displays the use of the BitArray class:

using System;
using System.Collections;
public class MyBitArrayClass
{
   public static void Main()
   {
      BitArray mybitarr1 = new BitArray( 7 );
      BitArray mybitarr2 = new BitArray( 9, false );
      byte[] myBytes = new byte[5] { 1, 2, 3, 4, 5 };
      BitArray mybiarr3 = new BitArray( myBytes );

      Console.WriteLine( "mybitarr1" );
      PrintTheValues( mybiarr1 );
      Console.WriteLine( "mybitarr2" );
      PrintTheValues( mybitarr2 );
      Console.WriteLine( "mybitarr3" );
      PrintTheValues( mybitarr3 );
   }
   public static void PrintTheValues( IEnumerable MyList)
   {
      foreach ( Object list in MyList )
      Console.Write( list )
   }
}


Rating:



Other articles

Click here to Article home

 
uCertify.com | Our Company | Articles | Privacy | Security | Contact Us | News and Press Release | uCertify India
MCSE: MCSA, MCTS, MCITP    JAVA Certification: SCJP, SCWCD Cisco Certification: CCNA, CCENT, A+, Network+, Security+
Oracle Certification: OCP 9i, OCP 10g, OCA 9i, OCA 10g CIW foundation    EC-212-32    CISSP    Photoshop ACE    Adobe Flash ACE
© 2008 uCertify.com. All rights reserved. All trademarks are the property of their respective owners.