MAVEN / NOTES</>↗Maven07 Dec 2023
To compile and execute a JDK preview features with Maven, you need to add in the following configurations in your pom.xml file: Compiler Plugin: The configuration should specify the JDK version and enable the preview features. It should look similar to this: <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <release>21</release> <compilerArgs>–enable-preview</compilerA...
JAVA 8 / NOTES</>↗Java 807 Dec 2023
If you have a collection of objects and want to sum one of their properties using the Java Stream API, you need to use the map() function to convert each object into the value of its property and then use the reduce() function to sum all the values. Here is an example where we have […]
GENERAL / NOTES</>↗General18 Nov 2023
In this Tutorial, we will learn about how to read a file in Java. File manipulation is a fundamental aspect of programming, especially when dealing with data processing and storage. Java provides robust libraries and classes to handle file operations efficiently. In this in-depth tutorial, we will explore the various techniques and best practices for […]
JAVA DATE TIME API / NOTES</>↗Java Date Time API04 Oct 2023
The following code snippet shows you how to iterate through a range of dates in Java. We use the Java Date Time API. We do increment and decrement iteration using a simple for loop. Here are the steps: We declare the start and end date of the loop, the dates are instance of java.time.LocalDate. Create […]
GENERAL / NOTES</>↗General20 Sep 2023
Welcome, future developers! If you’re looking to connect your Java applications with databases, you’re in the right place. Java Database Connectivity, commonly known as JDBC, is the bridge that links them together. It’s a powerful tool in a developer’s toolkit, allowing seamless interaction between Java and various databases. Dive into this tutorial, and by the […]
BASIC / NOTES</>↗Basic31 Aug 2023
The following code demonstrates how to create a string of repeated characters. We use the String.repeat(int count) method introduced in Java 11. This method takes one parameter of type int which is the number of times to repeat the string. The count must be a positive number, a negative number will cause this method to […]