Redesigned Generics/Collections in Java 8.

Collections were redesigned to improve  below:

  1. performance of  HashMap with key collisions. The new HashMaps were handling collisions with a balanced tree instead of a LinkedList. These changes were only applied to HashMap , LinkedHashMap and ConcurrentHashMap.
  2. Aggregate Functions are defined in collection frameworks to collaborate with lambda expressions (This will be explained in Lambda expressions)
  3. Now Collections have forEach methods as default implementation to facilitate streams.
  4. Java 8 allows interfaces to have default implementations .

Leave a comment