Java Basic
Deque in Java
Interface Deque (short for Double-Ended Queue) in Java is an interface that defines a data structure that allows us to add or remove elements at the front or rear: You can watch the videos below: and: This Deque interface extends from the Queue interface and… Read More
Switch statement in Java – Part 2
In the previous tutorial, I introduced you to the basic knowledge of the switch statement in Java. In this tutorial, I will talk more about the new features that Java supports from version 14 onwards! Switch from Java 14 When working with a switch statement,… Read More
Install JDK using SDKMAN
I have guided you how to install Oracle JDK on macOS by downloading the Oracle JDK installation files and installing it manually. There is another way that is much more convenient and easier which is to use the SDKMAN (Software Development Kit Manager) tool. How… Read More
Virtual thread in Java
In the tutorial Initializing and running a thread in Java, I introduced you to Java’s Thread class to create a new thread. Threads created by this Thread class are called platform threads and the number of platform threads that can be created is limited, depending… Read More
Scoped Value in Java
Scoped Value in Java is a Java feature that allows us to get immutable data anywhere in related code we want, without having to pass this data from this method to another method so that it can be used later in a method that needs… Read More
ThreadLocal in Java
The ThreadLocal class in Java is a class that allows us to store and retrieve the values of variables in the same thread. As long as it’s the same thread, you can store a value and retrieve it whenever we want. You can initialize objects… Read More
Structured Concurrency in Java
Structured Concurrency in Java is an improvement of Java from Java 19, on implementing and maintaining code related to the execution of tasks consisting of many sub-tasks handled by multi-threading. This improvement makes our code easier to read, and controls how the execution of subtasks… Read More
Working with .properties files using the Properties class in Java
.properties files are files used to configure information for the application. This is information that can change during the process of developing and deploying the application to the production environment. This information will be defined with key and value pairs in the .properties file, for… Read More
Format string in Java
In Java, to format a string to include what values, where these values are taken, you can use the static format() method of the String object along with the format you want. To format and print a string to the console, you can use the… Read More