Map in Java: HashMap, LinkedHashMap and TreeMap
A Map stores key to value pairs with unique keys, and it is the collection you will reach for most often.
Core Java, object oriented programming, collections, multithreading and JDBC.
100 notes in 18 topics
A Map stores key to value pairs with unique keys, and it is the collection you will reach for most often.
Buckets, hashing, collisions and resizing. Understanding the mechanism explains the performance and every rule about keys.
A Queue processes elements in an order it decides. A Deque works at both ends, and it is the right way to build a stack in Java.
An Iterator walks a collection one element at a time, and it is the only safe way to remove during a traversal.
Comparable gives a class one natural order. Comparator supplies any number of orders from outside, without touching the class.
The helper methods that save writing loops, and a practical way to pick the right collection every time.
Generics let a class or method work with a type supplied by the caller, moving whole families of errors from runtime to compile time.
Bounds restrict what a type parameter may be, and wildcards let a method accept a family of parameterised types safely.
Generic type information exists only at compile time. Knowing what the compiler removes explains every generics restriction.
A lambda is a short way to write an implementation of a single method interface, so behaviour can be passed around like a value.
An interface with exactly one abstract method can be implemented by a lambda, and the standard library supplies the ones you need most.
When a lambda does nothing but call an existing method, a method reference says the same thing with less noise.