Anonymous Inner Class vs Lambda Expression

In this article, we will be going to explore the differences between lambda expression and anonymous inner Class. We will understand when to use one over the other and compare their syntax, behavior using example. Introduction Before going through the topic Lambda Expression and Anonymous Inner class let’s have look each of them. Anonymous classes … Read more

Adapter Design Pattern in Java

In this article we will look into Adapter Design Pattern in java and try to understand what problem it solves and its practical use case. Adapter design pattern is one of the structural design pattern and is used to make two unrelated interfaces work together. The object that joins these unrelated interfaces is called an … Read more

Arrays.asList() and List.of()

In this tutorial, we will try to compare the two main ways of initializing arrays Array.asList() and List.of() and also discuss the Difference between. Introduction Java provides several convenient ways for creating lists, like Arrays.asList() and List.of(), both are need to create a small list or convert an array into a list for convenience. Arrays … Read more

Facade Design Pattern in Java

Facade Design Pattern is behavioural design pattern. In this article we will look into the details of it and will discuss it with real time example to get clear picture is of its usage and applicability. Introduction Facade design pattern come under behavioural design pattern that provide simplified interface to access the complex functionality in … Read more

Observer Design Pattern in Java

In this article we will look int the Observer design pattern which come under behavioral design pattern and try to understand what problems it solves and its applicability. Introduction Observer is a behavioral design pattern. In this design pattern an observable is an object which notifies observers about the changes in its state. Let’s understand … Read more

Prototype Design Pattern in java

In this article we will look into Prototype Design Pattern in java and try to understand what problem its solve and its practical use case. A Prototype Design Pattern is a creational pattern that helps to create new objects by copying an existing object. This pattern is particularly useful when creating objects is complex or … Read more

Method Reference in Java 8

In this article we will look in to the new feature called method reference in Java and explore the different types of method references in details with example. Introduction Method reference is a special type of lambda expression which are often used to creates simple lambda expressions by referring existing method. Method references can be … Read more

Factory design pattern in Java

Factory Design Pattern in Java is creational design pattern, in this article we will look into this and try to understand the what problem it solves and its practical uses. Introduction Factory Method is a creational design pattern that provides an interface for creating objects without specifying the exacts class that will be instantiated. In … Read more

Singleton design pattern in Java

In this article we will look into singleton design pattern in java and try to explore different ways to create singleton and some of its best practices. And also look how to break singleton. Introduction Singleton design pattern is creational design pattern this is used to ensure that a class has only one instance and … Read more

Builder design pattern in java

In this article we will look into builder design pattern in java and try to understand what problem it solves and its practical use case. Introduction There is different ways of creational design pattern and provide different mechanism to create object that help in increasing the flexibility and also promote code re-usability. Factory Method: Provide … Read more