Opt In (Do Not Edit Here)

Jul 29, 2011

About ArrayList()


  • The ArrayList is not guaranteed to be sorted
  • The capacity of an ArrayList is the number of elements the ArrayList can hold.
  • As elements are added to an ArrayList, the capacity is automatically increased as required through reallocation.
  • ArrayList accepts nullNothingnullptra null reference (Nothing in Visual Basic) as a valid value and allows duplicate elements.
  • It can support multiple readers concurrently, on condition that the collection is not modified.

/*-----------------Sample Program---------------------*/

using System;

using System.Collections;

namespace ConsoleProgramming


class Program


static void Main(string[] args)


//Intializes a new empty instance of ArrayList Class

//with default initial capacity.

ArrayList al = new ArrayList();

al.Add("Mayur"); //add String value to ArrayList

al.Add(123); //add Integer value to ArrayList

al.Add(12.13); //add Float value to ArrayList

al.Add(12.12484217584); //add Double value to ArrayList

foreach (var item in al)

{ Console.WriteLine(item); //Print each 'item' in ArrayList }






About The Author :

Freelancer and IT Engineer
Softwares Developed by Mayur Dighe ImmortalDotNet.WordPress.com


All Rights Reserved. 2014 Copyright SIMPLITONA

Powered By Blogger | Published By Gooyaabi Templates Designed By : BloggerMotion