JavaGian java tutorial and java interview question and answer

JavaGian , Free Online Tutorials, JavaGian provides tutorials and interview questions of all technology like java tutorial, android, java frameworks, javascript, ajax, core java, sql, python, php, c language etc. for beginners and professionals.

linkedhashmap in java collection with Example

we will see about LinkedHashMap in java. LinkedHashMap is same as HashMap except that it maintains insertion order.
Some points about LinkedHashMap
  1. LinkedHashMap implements Map interface and extends HashMap class.
  2. LinkedHashMap maintains insertion order, so when you will be able to access elements in the order they were inserted like ArrayList.
  3. LinkedHashMap maintains doubly Linked list to maintain insertion order.

Example:

LinkedHashMapMain.java

.