Can you store multiple data types in System.Array?

Answer Posted / raj

yes it is possible.
create an array of objects.

int i = 100;
string s = "hundred";

object [] obj = new object[2];
obj[0] = i;
obj[1] = s;

textbox1.Text = System.Convert.ToInt32(i) + "=" + s.ToString
();

Is This Answer Correct ?    10 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to do and Apply Themes to Datagrid,Lable,Textbox,etc., in C#.NET 2005 Windows Application? (like who we will do themes in ASP.NET using .CSS and .SKIN files). Urgent!!

1864


What's the difference between the debug class and trace class? Documentation looks the same.

707


What is signature c#?

654


Can you put two constructor with the same structure in a class?

684


Define strong name in c#?

682


What is access specifier in c#?

768


Is it possible to have different access modifiers on the get/set methods of a property in c#?

765


Why are local variables stored in stack?

755


What is a console operator?

657


Can interface inherit class in c#?

685


When should we use sealed class in c#?

668


What is difference between il and dll ?

726


Why do we need static class in c#?

735


Explain copy constructor?

866


What is singleordefault c#?

681