We are providing online training of realtime Live project on Asp.Net MVC with Angular and Web API. For more information click here. If you have any query then drop the messase in CONTACT FORM

Saturday, June 27, 2015

Add items to StringCollection and display values of StringCollection using ArrayList.

class StringArray
    { 
        static void Main()
        {
            StringCollection ObjSC = new StringCollection();
            ObjSC.Add("Computer");
            ObjSC.Add("Laptop");
            ObjSC.Add("Mpbile");
            ObjSC.Add("SmartPhone");
            ObjSC.Add("Speaker");

            ArrayList ObjAL = new ArrayList();
            ObjAL.Add("Mithilesh");
            ObjAL.Add("Sohan");
            ObjAL.Add("Rakesh");
            ObjAL.AddRange(ObjSC);

            foreach (string items in ObjAL)
            {
                Console.WriteLine(items);
            }
            Console.ReadLine();
        }
    } 

Output:

No comments: