-
Enumerated Types
Enumerated types, also known as enums, in Java are a special data type that enables a variable to be in a restricted set of named values. The enum keyword offers a way to…
-
Search Algorithms
Linear Search Given an array of n elements, find a specific element (x) in the array and return it’s position. Binary Search Binary search tackles the problem of locating a specific element within…
-
Avoid NullPointerExceptions with Optional
Optionals are commonly used to prevent null references and NullPointerExceptions in Java code. An Optional is a container object which may or may not have a value. To verify if a value exists,…
-
Working with Queues in the Collections Framework
The queue data structure can be useful in algorithms where you need to process data in a sequential order. A queue contains the elements in the order they were added, that is, elements…
-
Spring Authorization Server
This article is based on Spring Framework 6. In a recent blog post on the Spring website, Steve Riesenberg announced that the Spring Authorization Server is now available on Spring Initializr. This means that developers can…
-
Lamdas
Lambdas are a way of using functional programming to develop concise and powerful Java code since Java version 8. Lambdas implement functional interfaces using the @FunctionalInterface annotation which will contain a single method…
-
The Collections interface
The Collections interface is the root interface extended by most collection types and defines common methods for all collection types. Interfaces and concrete implementations of a list, set and queue will inherit these…
-
Spring Security 6 with basic authentication
In this tutorial, we are going to set up Spring Security in a Spring Boot servlet application and configure an in-memory user to test authentication. Pre-requisites Step 1 : Add the Spring Security…
-
Spring Data
When an application requires interaction with a database, that often means implementing a considerable amount of boilerplate code which, over time, becomes difficult to maintain. Spring data eliminates boilerplate code and abstracts database…
-
The Springboot web starter
Spring web starters are a common place to start building web applications or services and in the Spring world, web applications and services are considered as the same. A single application can contain…