Home » Core Java

Core Java

Java Factory Method Design Pattern Example

1. Introduction In this article we will discuss one of Java’s most common design patterns – Factory Method Design Pattern. This type of design pattern is a type of creational design pattern but it is one of the finest ways to generate an object. So, in Factory Method design pattern, we develop objects but without revealing the logic or functionality of creation ...

Read More »

Java 8 Stream Collectors groupingBy Example

1. Introduction SQL GROUP BY is a very useful aggregation function. It groups database records on certain criteria. Java 8 Stream API enables developers to process collections of data in a declarative way. Java 8 Collectors class provides a static groupingBy method: to group objects by some property and store the results in a Map instance. It has three signatures, which ...

Read More »

Java Builder Design Pattern Example

1. Introduction In this article, we will describe Java Builder Design Pattern in detail. The Builder design pattern, as its name suggests, seems to be an alternative way to develop complex objects. This can only be used if you choose to create different unchangeable objects who use the same process of object building. This design pattern in Java is a type of Creational ...

Read More »

Java 8 TemporalAdjusters Example

1. Introduction Java 8 Date-Time API is a JSR-310 implementation. It has a new set of packages to provide a comprehensive date-time model. java.time – base package for managing dates and times java.time.chrono – handles alternative calendaring and chronology systems java.time.format – handles formatting of dates and times java.time.temporal – accesses to date and time using fields, units, and adjusters Java 8 ...

Read More »

Java Flyweight Design Pattern Example

1. Introduction In this article, we will look at the Java flyweight design pattern. This design pattern helps us to reduce the memory usage. It can also improve performance in applications where object attachment is costly. The main intent of Flyweight design pattern is “Facilitates the reuse of many fine grained objects and makes the use of large numbers of ...

Read More »

Gradle Hudson Example

This post is about integrating Gradle, a programmable build system into Hudson, a Continuous Integration server. We will also take a look at the configuration required to run a simple application. 1. Introduction 1.1. Hudson The term ‘Continuous Integration’ originated with the Extreme Programming development process, as one of its original twelve practices. Each developer works individually in their Version ...

Read More »

Java Chain of Responsibility Design Pattern Example

1. Introduction In this article, we will discuss about a widely used Design pattern – Java Chain of Responsibility Design Pattern. In the name itself it suggests that, the Chain of responsibility design pattern generates a chain of receiver objects for a request. This pattern separates the sender and receiver for a request based on the type of request. This design pattern is a classification ...

Read More »

MySQL Python Example

1. MySQL Python – Introduction In this post, we feature a comprehensive Tutorial on integrating MySQL in a simple Python application based on Flask and execute basic CRUD operations with the same. MySQL is one of the most used SQL databases in many of the world-enterprise applications due to its ability to manage transactions and the ACID-behaviour which is built into its ...

Read More »

Java Proxy Design Pattern Example

1. Introduction In this article, we will discuss about one of the simple and easiest design pattern – Java Proxy Design Pattern. In real world proxy means representative or on behalf of or in place of are exact synonyms of proxy. In Simple words, proxy means an object representing another object. According to this, we can do many operations like encapsulating the ...

Read More »

Java 8 Check if Array Contains a Certain Value Example

1. Introduction An array is a data structure which holds a fixed number of values of a single type. In this example, I will demonstrate how to check if an array contains a certain value in three ways: Convert an array to a Collection and check with the contains method Use Arrays.binarySearch to check when the array is sorted Convert an array ...

Read More »