Pattern Matching for Switch

According to some surveys such as that of JetBrains, version 8 of Java is currently the most used by developers all over the world, despite being a 2014 release.

What you are reading is the one in a series of articles titled “Going beyond Java 8”, inspired by the contents of my books “Java for Aliens” (English) and “Il nuovo Java” (Italian). These articles will guide the reader step by step to explore the most important features introduced starting from version 9. The aim is to make the reader aware of how important it is to move forward from Java 8, explaining the enormous advantages that the latest versions of the language offer.

Where To Use the Underscore in Java

This series of articles called “Stranger things in Java”, is inspired by the contents of my book “Java for Aliens”. These articles are dedicated to insights into the Java language. Deepening the topics we use every day will allow us to master Java coding even in the strangest scenario.

In this article, we will try to clarify the use of the underscore symbol "_" in Java programming. So, let's examine the use cases of this symbol within a Java program. Let's start with the best-known case.

Going Beyond Java 8: Local Variable Type Inference (var)

According to some surveys, such as JetBrains's great survey, Java 8 is currently the most used version of Java, despite being a 2014 release.

What you are reading is one in a series of articles titled 'Going beyond Java 8,' inspired by the contents of my book, Java for Aliens. These articles will guide you step-by-step through the most important features introduced to the language, starting from version 9. The aim is to make you aware of how important it is to move forward from Java 8, explaining the enormous advantages that the latest versions of the language offer.

What Are the Differences Between Interfaces and Abstract Classes in 2021?

What you are reading is the fifth in a series of articles titled "Stranger things in Java", inspired by the contents of my book "Java for Aliens". These articles are dedicated to insights into the Java language. Better understanding the topics we use every day will allow us to master Java coding in even the most difficult scenarios.

The definitions for abstract class and interface have evolved since version 8 of Java, and knowing how the two now differ and interact is crucial. An understanding of their key differences will help users best work with these tools to leverage their full potential. 

Stranger Things in Java: Constants

What you are reading is the fourth in a series of articles titled "Stranger things in Java", inspired by the contents of my book "Java for Aliens". These articles are dedicated to insights of the Java language. Deepening the topics we use every day will allow us to master the Java coding even in the strangest scenario.

Introduction

In this article, we will explore some scenarios involving the use of constants where even experienced programmers may have doubts. Although the topic may be well known, not everyone has explored particular scenarios such as solving multiple inheritance in presence of homonymous constants. Strengthening one's theoretical basis is essential to be able to program with confidence.

Going Beyond Java 8: Text Blocks

Introduction

String is undoubtedly the most used class in Java, and represents an exception among the classes of the standard library. In fact, its objects are always immutable, and these can be instantiated with a simplified syntax that makes us avoid the verbosity of the new operator and the call to the constructor, as is standard for almost all other classes. In addition, the memory management of these String objects is characterized by the reuse of instances already created through an internally-managed pool of strings. 

In the latest versions, other improvements are being made to this fundamental class to make its use more efficient, simpler to use, and less verbose. The compact strings introduced in Java 9 have undoubtedly made strings more performing. Then with Java 13, a new feature called text blocks has been introduced that allows us to use the String class in a more profitable and easier way. 

Going Beyond Java 8: Pattern Matching for instanceof

Introduction

According to some surveys, like JetBrains's great survey, Java 8 is currently the most used Java version, despite being a 2014 release.

This article is the first in a series of articles titled, "Going Beyond Java 8," inspired by the contents of my book "Java for Aliens." These articles will guide the reader step-by-step to explore the most important features introduced starting with Java 9. The aim is to make the reader aware of how important it is to move forward from Java 8, explaining the enormous advantages that the latest versions of the language offer.

Going Beyond Java 8: Feature Preview

According to some surveys, such as that of JetBrains, version 8 of Java is currently the most used by developers all over the world, despite being a 2014 release.

What you are reading is the first in a series of articles titled 'Going beyond Java 8,' inspired by the contents of my book 'Java for Aliens.' These articles will guide the reader step by step to explore the most important features introduced, starting from version 9. The aim is to make the reader aware of how important it is to move forward from Java 8, explaining the enormous advantages that the latest versions of the language offer.

Stranger Things in Java: Constructors

Introduction

What you are reading is the second in a series of articles titled “Stranger things in Java” (find the first article here), inspired by the contents of my book “Java for Aliens”. These articles are dedicated to insights of the Java language. Deepening the topics we use every day, will allow us to master Java coding even in the strangest scenario.

In this post, we will explore some scenarios in which the use of a Java programming base concept, such as the constructor, can hide some pitfalls. In particular, after having clarified some fundamental definitions, we will explore the relationships between constructors and inheritance, constructors and polymorphism, and the hidden work of the compiler.