Java

HashMap in Java with Examples

HashMap is a part of Java’s collection since Java 1.2. This class is found in java.util package. It provides the basic implementation of the Map interface of Java. It stores the data in (Key, Value) pairs, and you can access them by an index of another type (e.g. an Integer). One object is used as a key (index) to another object (value). If you try to insert the duplicate key, it will replace the element of the corresponding key.

Design Patterns

Design Patterns – Builder Pattern Builder pattern builds a complex object using simple objects and using a step by step approach. This type of design pattern comes under creational pattern as this pattern provides one of the best ways to create an object. Design Pattern – Singleton Pattern Singleton pattern is one of the simplest …

Design Patterns Read More »

Java Inner Classes

Java inner class or nested class is a class which is declared inside the class or interface. We use inner classes to logically group classes and interfaces in one place so that it can be more readable and maintainable. Additionally, it can access all the members of outer class including private data members and methods. Syntax …

Java Inner Classes Read More »

Show Buttons
Hide Buttons