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

What are the problem with .NET generics?

546


Why do we use ienumerable in c#?

477


What is difference between abstraction and encapsulation in c#?

510


What is difference between constants and read-only?

442


How do I declare a pure virtual function in c#?

584






Differentiate between object pooling and connection pooling in c#?

532


is it possible to access a remote web service Without UDDI?

530


What is difference between function and method in c#?

455


What is sorting in c#?

511


What is the use of 'using' statement in c#?

482


Can a private virtual method can be overridden?

552


If I have more than one version of one assemblies, then how'll I use old version (how/where to specify version number?)in my application?

518


How can I access the registry from c# code?

509


What are data types in C#?

560


What is a generic class?

521