Java Double Brace Initialization 1. Overview In this quick tutorial, we’ll show how double braces can be used for creating and initializing objects in a single Java expression. We’ll also look at why this technique can be considered an anti-pattern. 2. Standard Approach Normally we initialize and populate a set… Continue Reading java-double-brace-initialization

Replace a Character at a Specific Index in a String in Java 1. Introduction In this quick tutorial, we’ll demonstrate how to replace a character at a specific index in a String in Java. We’ll present four implementations of simple methods that take the original String, a character, and the index… Continue Reading java-replace-character-at-index

Spring Cache – Creating a Custom KeyGenerator 1. Overview In this quick tutorial, we’re going to illustrate how to create a custom key generator with Spring Cache. For an introduction to the above module, please refer to this article. 2. KeyGenerator This is responsible for generating every key for each… Continue Reading spring-cache-custom-keygenerator