GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Microsoft  >  DotNet
Go To First  |  Previous Question  |  Next Question 
 DotNet  |  Question 110 of 165    Print  
what\'s ArrayList in .Net (VB.Net or C#)
What\'s the advantageous using ArrayList.

  
Total Answers and Comments: 6 Last Update: October 08, 2007     Asked by: Behnam 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
November 28, 2005 15:41:42   #1  
sivakesh        

RE: what's ArrayList in .Net (VB.Net or C#)What...

ArrayList is an extended managment of Arrays....

ArrayList can hold objects(custom...or...defined)

say i have an object user with properties name and email

my AraayList can hold users object...means one or more

Array is Type specific....so can hold Types like int string etc......

...Thanks Sivakesh.

http://www.sivakesh.com


 
Is this answer useful? Yes | No
January 09, 2006 06:43:41   #2  
samiksc Member Since: October 2005   Contribution: 233    

RE: what's ArrayList in .Net (VB.Net or C#)What...

ArrayList class implements IList interface using an array.

Advantages:

  1. Its capacity is increased if required as objects are added to it. So it frees programmer from the worries of array overflow.
  2. Provides methods to perform common operations -- append insert remove replace etc.
  3. There is no restriction on the type of objects which can be added to an arraylist. First object could be a string second a double third a user defined object and so on.
  4. ArrayList can be made read only after adding elements to prevent unintentional modifications.
  5. It provides an overloaded method to perform binary search on its objects.

 
Is this answer useful? Yes | No
January 09, 2006 06:46:12   #3  
Bharat Joshi        

RE: what's ArrayList in .Net (VB.Net or C#)What...

ArrayList is also a datastructure in dotnet which contain data in it thr major difference in between array and arraylist is insertion and deletion of data In ArrayList we can eaisely insert Data at a particular location while in array it is not possibel


 
Is this answer useful? Yes | No
May 12, 2006 08:16:53   #4  
Sanjay Talreja        

RE: what's ArrayList in .Net (VB.Net or C#)What...

Array is for homogeneous data. i.e data of same data type.

Whereas Arraylist is for Heterogeneous data.The data in the arraylist need not be of same data type.

Also it(arraylist) can store objects. say objects of type account.


 
Is this answer useful? Yes | No
July 14, 2006 13:02:27   #5  
Raghu        

RE: what's ArrayList in .Net (VB.Net or C#)What...

Suppose that u r using an array of intgers.Which may contain any numer of integers which you know only at runtime.

So while coding u cannot specify the size of the Array.

Array list is used to solve this problem.

It has a default size(16 items).

if u have even 1 item the size will be 16.

After 16 if u add another item the size increases to 32.

i.e the arrayList size can be increased dynamically.


 
Is this answer useful? Yes | No
October 08, 2007 02:49:28   #6  
Sonali        

RE: what's ArrayList in .Net (VB.Net or C#)What...

Array is for homogeneous data. i.e data of same data type.

Whereas Arraylist is for Heterogeneous data. The data in the arraylist need not be of same data type.

Also it (arraylist) can store objects say objects of type account.


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape