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
Does c# have primitives?
Contrast System.String and System.Text.StringBuilder classes?
What is c# entity framework?
How long can loop recorders stay in?
Is java better than c sharp?
What is the main purpose of xml?
What is lazy keyword in c#?
What is console used for?
Why is hashset faster?
Which namespaces are necessary to create a localized application?
What is unrecognized escape sequence in c#?
Explain data types in c#?
what are implementation inheritance and interface inheritance?
Differentiate between response.expires and response.expiresabsolute?
What is sql transaction in c#?