Header Ads

Header Ads

How to store different data type value in array


How to store different data type value in array

freiend as we know array is a collection of same data type value .The array doesnot allow
            to store different data  type of value to overcome this proplem we use array list class.
            friends today we are use arraylist class to store multiple data type value .
             first you include using System.Collection namespace in your application
             you right following code in Main Function
            ArrayList a = new ArrayList();
            a.Add("keshav ");
            a.Add(19);
            foreach (object i in a)
            {
                Console.WriteLine(i);
            }
This code is useful to store multiple data type value in array

No comments:

Powered by Blogger.