C# ArrayList IsFixedSize

Description

ArrayList IsFixedSize gets a value indicating whether the ArrayList has a fixed size.

Syntax

ArrayList.IsFixedSize has the following syntax.


public virtual bool IsFixedSize { get; }

Example


using System; /*from  w ww  .  j  a  va2s.  com*/
using System.Collections; 
 
class MainClass { 
  public static void Main() { 
    ArrayList al = new ArrayList(); 
     
    Console.WriteLine("Initial number of elements: " + al.Count); 
 
    Console.WriteLine("Adding 6 elements"); 
    // Add elements to the array list 
    al.Add('C'); 
    al.Add('A'); 
    al.Add('E'); 
    al.Add('B'); 
    al.Add('D'); 
    al.Add('F'); 
 
    Console.WriteLine(al.IsFixedSize); 
  }
} 

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Collections »




ArrayList
BitArray
Comparer
Hashtable
Queue
SortedList
Stack