There are two ways to store the different types of arrays in C#.
- Object type is a base type for all the types in .net
Example
using System.Collections;
namespace article
{
class programme
{
static void main()
{
object[] a = new object[3];
a[0] = 101; //interger
a[1] = c#; //string
foreach( object obj in a)
{
console.writeline(obj);
}
}
}
}
- Another method is to use the "array list class that present in System.collection namespace".
ArrayList array = new arraylist();
array.add(1);
array.add(abc);