Diffrence between arraylist and hashmap

Answers were Sorted based on User's Feedback



Diffrence between arraylist and hashmap..

Answer / srikanth

arraylist is used for storing collection of elements with
duplicates
they can store only keys
it is extending list interface

hashmap
--------
hashmap is used for storing collection of elements with key
value pair without duplicates in unordered way

it is extending map interface

Is This Answer Correct ?    6 Yes 0 No

Diffrence between arraylist and hashmap..

Answer / srikanth

Arraylist is an ordered collection.of objects
they store their elements in index.rotation
Duplicate values are also allowed.
they show their elements in order ie... added order

But in hashmap is also ordered collection but don't contain
duplicate values.
Hashmap use key value for any object access.
hashmap allow null values

Is This Answer Correct ?    3 Yes 2 No

Diffrence between arraylist and hashmap..

Answer / billuyadav208

Arraylist is an ordered collection.
User access elements by their interger index.
Duplicate values are also allowed.
But in hashmap is also ordered collection but don't contain
duplicate values.
Hashmap use key value for any object access.

Is This Answer Correct ?    4 Yes 4 No

Post New Answer

More J2EE Interview Questions

What is event and listener in java?

0 Answers  


What is the best java compiler?

0 Answers  


Define thin client?

0 Answers  


What is j2ee stack?

0 Answers  


How do you run a java program?

0 Answers  






Use of private variable while creating properties ???

1 Answers  


Why do we use DAO?

3 Answers   Accenture, Tech Mahindra,


What is B2B?

0 Answers  


What is the difference between sendRedirect() and forward()? in what situations do we have to use send redirect() instead of forward().

13 Answers   Honeywell, Mind Tree, Samsung, Wipro,


how many external variables are there in jsp ?

1 Answers  


Why primitive data types in java are not objects?

0 Answers  


What is distributed application?

0 Answers  


Categories