Can you store multiple data types in System.Array?

 Posted by Chikul on 12/21/2009 | Category: .NET Framework Interview questions | Views: 9125

No, If the System.Array is of Some Particular Data Type.(Primitive Data Type)

yes, If the System.Array is of Object Type.

Ex :

create an array of objects.

int in = 50;
string st = "Fifty";

object [] obj = new object[2];
obj[0] = in;
obj[1] = st;

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response