Can you store multiple data types in System.Array?
Answer Posted / vishal
Ok, so here is the catch:
An array of objects can store different datatype members -
object[] ar = new object[3];
ar[0] = "test";
ar[1] = 56;
An arraylist can also be used for this purpose -
ArrayList arr = new ArrayList();
arr.Add(56);
arr.Add("ASDf");
And a generic list too can be used for this purpose -
List<object> llst1 = new List<object>();
llst1.Add(56);
llst1.Add("ASDf");
| Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
List down the access modifiers available in c#?
What do you mean by “finalize” and “finally” methods in c#?
Is unity object oriented?
Do while loops yes or no c#?
Can struct have constructor c#?
Explain inheritance in c#?
What is difference between field and property in c#?
What is inheritance c#?
Is a games console a computer?
How to open a new form on button click in Windows forms?
What is namespace c#?
What is difference between il and dll ?
What is the difference between wrapper class and primitive?
How do I create a multilanguage?
What do you mean by hashtable c#?