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
Why to use “using” in c#?
What exactly happens when we debug and build the program?
What does return do in for loop?
Which language is used for desktop application?
Is array ienumerable c#?
Can you inherit multiple classes in c#?
What is the use of protected in c#?
How is the syntax written to inherit from a class in C#?Give an example ?
Which of these string definitions will prevent escaping on backslashes in c#?
Explain the role of Garbage collector and its generations?
What are sessions in c#?
1. Describe page life cycle?
Is c# code is managed or unmanaged code?
What is sqladapter c#?
What are the 3 types of comments in c#?