How to convert an Array into an ArrayList?

 Posted by Raja on 7/14/2008 | Category: ASP.NET Interview questions | Views: 8751
Answer:

Lets say you have array of Person object and you are getting an it from LoadPersons() method of your object like this

Person[] myPersonArray = myPerson.LoadPersons();

Now, if you want to convert above array into an ArrayList just write like this

ArrayList myPersonList = ArrayList.Adapter(myPersonArray );


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response