.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

Difference between arraylist and hash table?

Posted By: Ramesh P     Posted Date: October 31, 2010    Points:2   Category :C#
Difference between arraylist and hash table?

Responses
Author: Dhivakaran             
Posted Date: October 31, 2010     Points: 5   

In array list we can only add items to the list but in hash
list we can add data with the key .

-
Dhivakaran T
Author: Syed Shakeer Hussain             
Posted Date: October 31, 2010     Points: 5   

Arraylist is a collection of objects(may be of different types).
Arraylist is very much similar to array but it can take values of different datatypes.
If you want to find something in a arraylist you have to go through each value in arraylist, theres no faster way out.

Hashtable is also collection which takes a key corresponding to each values.
If you want to find something in a hashtable you dont have to go through each value in hashtable, instead search for key values and is faster.


Author: Don             
Posted Date: January 11, 2011     Points: 5   

disadvantage of Hashtable is the extra space that it takes for storing the key..But if you got a bulk amount of data and if you need to perform a frequent search then go for HashTable..if no arraylist will be enough..

Author: Shweta             
Posted Date: January 17, 2011     Points: 5   

the data in hashtable is stored in the key-value pair format whereas the data in arraylist is stored in as only the value.
arraylist is collection of similar datatypes and it has the functionality of dynamic reallocation.

Shweta Agashe
.Net Developer,Global Infobase Solutions.


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend