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
How can you write a class to restrict that only one object of this class can be created (Singleton class)?
What is the adv of using System.Text.StringBuilder over System.String?
What is object type in c#?
What is thread pooling?
What is a lambda expression in c#?
how encapsulation is implemented in c#
Define xslt.
What is Fragmentation and its Types?
What is called method in c#?
Is c# or c++ better for games?
Is enum a class c#?
How do I open the console window?
What is difference between string and stringbuffer in c#?
What does string format do?
Describe two uses of the “using” statement during the operation of c#?