Visit our site: Vist and Get Free Gifts

Learn To Build: Array List In C#

Visit our site: Vist and Get Free Gifts

Visit our site: Vist and Get Free Gifts

Tuesday, February 4, 2014

Array List In C#

using System;
using System.Collections; // we need to add this reference to use Files and Directory information
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ArrayLists
{
    class Program
    {
        static void Main(string[] args)
        {
            ArrayList myAL = new ArrayList();
            myAL.Add("one");
            myAL.Add(2);
            myAL.Add("three");
            myAL.Add(4);
            myAL.Insert(0, 1.25f);

            foreach (object o in myAL)
            {
                if (o is int)
                    Console.WriteLine("{0}", o);
            }
            Console.ReadLine();
        }
    }
}

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home