Add element in ArrayList

In this article I will explain that how can we add the element in the ArrayList.
  • 3144

We can add the elements in the ArrayList by using the add() method.

namespace ArrayList1

{

    class Program

    {

        static void Main(string[] args)

        {

            ArrayList ar = new ArrayList();

            ar.Add("Jan");

            ar.Add("Feb");

            ar.Add("March");

            ar.Add("April");

            ar.Add("May");

            ar.Add("June");

            ar.Add("July");

        }

    }

}

Further Readings

You may also want to read these related articles.

Ask Your Question

Got a programming related question? You may want to post your question here
 

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.