C# List List()

Description

List List () initializes a new instance of the List class that is empty and has the default initial capacity.

Syntax


public List()

Example


using System;//  w w w.  jav a2 s.  c  o  m
using System.Collections.Generic;

public class Example
{
    public static void Main()
    {
        List<string> myData = new List<string>();
        Console.WriteLine("\nCapacity: {0}", myData.Capacity);
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Collections.Generic »




HashSet
LinkedList
LinkedListNode
List
Queue
SortedSet
Stack