Home > DeveloperSection > Interviews > Can you store multiple data types in System.Array?

Posted on    October-25-2010 12:00 AM

 C# C# 
Ratings:
 2 Answer(s)
  935  View(s)
Rate this:

Pushpendra Singh

Total Post:241

Points:1205
Posted on    October-30-2010 12:00 AM

No, You can not store multiple data types in System.Array.
But if you have an object array then you can

Pushpendra Singh

Total Post:241

Points:1205
Posted on    October-30-2010 12:00 AM

If you take an array of object, you can store multiple data
type in an array.
object[] obj = new object[4];
obj[0]=1;
obj[1]="Neeraj";
obj[2]=true;
obj[3]=System.DateTime.Now;

Don't want to miss updates? Please click the below button!

Follow MindStick