Java Tutorials

Volatile Keyword in Java

In Java, the volatile keyword is used to declare a variable as volatile. When a variable is declared as volatile, […] Continue reading »

Functional Interface in Java 8

Java 8 introduced a significant enhancement known as lambda expressions, which allowed for more concise and expressive code. Alongside lambda […] Continue reading »

Java Atomic Variable

An atomic variable in Java refers to a variable that can be accessed and modified in a way that guarantees […] Continue reading »

forEach() vs. forEachOrdered() in Java Stream

When working with Java Streams, you often encounter situations where you need to apply a function to each element of […] Continue reading »

Finding a Specific Digit in a Number using Java

On this page, we’ll explore a simple yet common problem: finding a specific digit in a given number using Java. […] Continue reading »

Exploring the Optional in Java 8

Java 8 introduced several new features to the language, including the Optional class. This class was introduced to address the […] Continue reading »

Overview of Java 8 Date and Time API

Java 8 introduced a modern Date and Time API to address the shortcomings of the older java.util.Date and java.util.Calendar classes. […] Continue reading »

Lambda Expressions in Java 8

Java 8 brought a game-changing feature to the world of programming: lambda expressions. These concise and expressive constructs revolutionized the […] Continue reading »

Java 8 Default and Static Methods in Interfaces

Java 8 brought a significant enhancement to interfaces by introducing default and static methods. These additions allowed developers to evolve […] Continue reading »

Java 8 Stream generate() Method

In this article, we will explore the generate() method provided by Java 8 Stream API. The generate() method is a […] Continue reading »

Java Records: Simplify Data Classes

The record keyword was introduced in Java 16. It is a feature that simplifies the creation of classes for data […] Continue reading »

1 2 3 4 13