Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

List down the access modifiers available in c#?

867


What do you mean by “finalize” and “finally” methods in c#?

903


Is unity object oriented?

915


Do while loops yes or no c#?

966


Can struct have constructor c#?

911


Explain inheritance in c#?

945


What is difference between field and property in c#?

826


What is inheritance c#?

892


Is a games console a computer?

923


How to open a new form on button click in Windows forms?

949


What is namespace c#?

918


What is difference between il and dll ?

998


What is the difference between wrapper class and primitive?

857


How do I create a multilanguage?

917


What do you mean by hashtable c#?

1009