Sort Hashmap in Java with examples

The purpose of HashMap isn’t to keep entries in a sorted order, but Java provides you the option to sort HashMap on the basis of values or keys. To sort HashMap based on keys, all that is needed is creating a TreeMap by copying entries from the desired HashMap. One can implement SortedMap by TreeMap … Read more

What is Bridge Design Pattern?

Bridge Design Pattern

Bridge Design Pattern falls under the structural design pattern category. This pattern focuses on a limitation in the concept of abstraction. In the context of Java, we use inheritance to develop the concept of abstraction. Several implementation deviations support to achieve the inheritance. However, this permanently binds the implementation to the abstraction limiting the flexibility. … Read more