Collection in java
***
1.
1st thing is the hierarchy of the collection...Inthe interview question can be asked which is inherited or what implimented which interface....
2.Now the question will be...among all the collection when to use which one...
Some are ordered...
Ordered means...the way you have insert the element...when you retrieve...the same way it will show you...
Insertion..
1
2
3
4
1
2
3
4
Unordered...
Insertion...
1
2
3
4
2
3
1
4
Now the second thing is ...
While storing it is storing in sequential order or random worder...
Which collection allow you to accept duplicate entries. ... .
Now ....
How to traverse a list or map or set...
3 ways...
Using foreach loop...
Using for loop
Some sets are sorted...or lists are sorted ...
Like what ever you enter..
When you will retrive...it will give you the sorted output...
Like tree set ..
Difference between hash and tree set
What is sorted set...
What is array list and what is linked list...
Is array list is a sorted list , ordered list ?
Which set is sorted set and why tree set is sorted where as hash set is not ?
Map...
It stores value in key value pair...
Different types are there..but important ones are...
Hash map
Tree map...
Linked hashm ..
Tree map is sorted...
You can traverse map element ... By using entry set ...
Some difference questions...
------+
Difference between...hash and tree map
Is Collections and collection same...or both are different....if different ....why ...
#java Collection
#collectionsInJava
#collectionFrameworkInJava
#java collection framework
#JavaCollectionFramework
Comments
Post a Comment