Pankaj  Kumar Choudhary

Pankaj Kumar Choudhary

  • 71
  • 26.6k
  • 13.4m

Size of BitArray

Feb 27 2015 11:36 PM
Yesterday i was reading the topic of Collection in c# language and i faced a problem that.
In some  Collections like HashTable ,ArrayList ,Dictionary we are not necessary to define the size of Collection like:
 ArrayList list = new ArrayList(6);  //No error
Hashtable obj = new Hashtable(6);    //No error
ArrayList list = new ArrayList();       //No error
Hashtable obj = new Hashtable();    //No error
but in BitArray we can not declare a BitArray without  initialize it's size
BitArray obl = new BitArray(6);        //No error
BitArray obl = new BitArray();  //  It will show an error
why????????

Answers (2)