- Java.util - WeakHashMap
- Java.util - Vector
- Java.util - UUID
- Java.util - TreeSet
- Java.util - TreeMap
- Java.util - TimeZone
- Java.util - TimerTask
- Java.util - Timer
- Java.util - StringTokenizer
- Java.util - Stack
- Java.util - SimpleTimeZone
- Java.util - ServiceLoader
- Java.util - Scanner
- Java.util - ResourceBundle.Control
- Java.util - ResourceBundle
- Java.util - Random
- Java.util - PropertyResourceBundle
- Java.util - PropertyPermission
- Java.util - Properties
- Java.util - PriorityQueue
- Java.util - Observable
- Java.util - Locale
- Java.util - ListResourceBundle
- Java.util - LinkedList
- Java.util - LinkedHashSet
- Java.util - LinkedHashMap
- Java.util - IdentityHashMap
- Java.util - Hashtable
- Java.util - HashSet
- Java.util - HashMap
- Java.util - GregorianCalendar
- Java.util - Formatter
- Java.util - EnumSet
- Java.util - EnumMap
- Java.util - Dictionary
- Java.util - Date
- Java.util - Currency
- Java.util - Collections
- Java.util - Calendar
- Java.util - BitSet
- Java.util - Arrays
- Java.util - ArrayList
- Java.util - ArrayDeque
- Java.util - Home
Java.util Package Extras
- Java.util - Discussion
- Java.util - Useful Resources
- Java.util - Enumerations
- Java.util - Exceptions
- Java.util - Interfaces
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java.util.LinkedHashMap Class
Introduction
The java.util.LinkedHashMap class is Hash table and Linked pst implementation of the Map interface, with predictable iteration order.Following are the important points about LinkedHashMap −
The class provides all of the optional Map operations, and permits null elements.
The Iteration over a HashMap is pkely to be more expensive.
Class declaration
Following is the declaration for java.util.LinkedHashMap class −
pubpc class LinkedHashMap<K,V> extends HashMap<K,V> implements Map<K,V>
Parameters
Following is the parameter for java.util.LinkedHashMap class −
K − This is the type of keys maintained by this map.
V − This is the the type of mapped values.
Class constructors
Sr.No. | Constructor & Description |
---|---|
1 | LinkedHashMap() This constructs an empty insertion-ordered LinkedHashMap instance with the default initial capacity (16) and load factor (0.75). |
2 | LinkedHashMap(int initialCapacity) This constructs an empty insertion-ordered LinkedHashMap instance with the specified initial capacity and a default load factor (0.75). |
3 | LinkedHashMap(int initialCapacity, float loadFactor) This constructs an empty insertion-ordered LinkedHashMap instance with the specified initial capacity and load factor. |
4 | LinkedHashMap(int initialCapacity, float loadFactor, boolean accessOrder) This constructs an empty LinkedHashMap instance with the specified initial capacity, load factor and ordering mode. |
5 | LinkedHashMap(Map<? extends K,? extends V> m) This constructs an insertion-ordered LinkedHashMap instance with the same mappings as the specified map. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | This method removes all of the mappings from this map. |
2 | This method returns true if this map maps one or more keys to the specified value. |
3 | This method returns the value to which the specified key is mapped, or null if this map contains no mapping for the key. |
4 | This method returns true if this map should remove its eldest entry. |
Methods inherited
This class inherits methods from the following classes −
java.util.HashMap
java.util.AbstarctMap
java.util.Object
java.util.Map