Java ‘private’ Access Modifier 1. Overview In the Java programming language, fields, constructors, methods, and classes can be marked with access modifiers. In this tutorial, we’ll talk about the private access modifier in Java. 2. The Keyword The private access modifier is important because it allows encapsulation and information hiding, which… Continue Reading java-private-keyword

Fail-Safe Iterator vs Fail-Fast Iterator 1. Introduction In this article, we’ll introduce the concept of Fail-Fast and Fail-Safe Iterators. Fail-Fast systems abort operation as-fast-as-possible exposing failures immediately and stopping the whole operation. Whereas, Fail-Safe systems don’t abort an operation in the case of a failure. Such systems try to avoid… Continue Reading java-fail-safe-vs-fail-fast-iterator

Java – Random Long, Float, Integer and Double This quick tutorial will illustrate how to generate a long first using plain Java and using the Apache Commons Math library. This article is part of the “Java – Back to Basic” series here on Baeldung. 1. Generate an Unbounded Long Let’s… Continue Reading java-generate-random-long-float-integer-double

Introduction to JCache 1. Overview Simply put, JCache is the standard caching API for Java. In this tutorial, we’re going to see what JCache is and how we can use it. 2. Maven Dependencies To use JCache, we need to add the following dependency to our pom.xml: <dependency> <groupId>javax.cache</groupId> <artifactId>cache-api</artifactId>… Continue Reading jcache