Java 14 Arrives with a Host of New Features

Java 14 contains more new features than the previous two releases—most of them aimed at easing coding.

Quiz Yourself: Lambda Types (Advanced)

Can a lambda return a lambda?

Quiz Yourself: Functional Interfaces (Advanced)

Define and implement functional interfaces that work as expected.

Quiz Yourself: Lambda Expressions (Advanced)

The subtleties of using var in lambda expressions

Quiz Yourself: Two-Dimensional Arrays (Intermediate)

Using var with two-dimensional arrays requires careful attention.

Records Come to Java

A first look at how Java 14’s data records will change the way you code

Quiz Yourself: Understanding enums (Advanced)

The subtleties of using enums in a switch statement

Quiz Yourself: Final Classes (Intermediate)

The effects of declaring a class final

Quiz Yourself: Default Methods (Advanced)

What fields can you access from default methods in interfaces?

Quiz Yourself: Manipulate Data with StringBuilder (Intermediate)

When two object references point to the same StringBuilder instance, how are changes propagated?

Quiz Yourself: Identify the Scope of Variables (Intermediate)

Nuances of variable scope in for-loops

Quiz Yourself: Inner, Nested, and Anonymous Classes (Advanced)

Java’s mechanisms and syntax for defining classes inside other classes

Quiz Yourself: String Manipulation (Intermediate)

The subtleties of string concatenation

Quiz Yourself: Variable Declaration (Intermediate)

The scope rules of Java variables and an examination of shadowing

Inside Java 13’s switch Expressions and Reimplemented Socket API

Incremental changes bring future benefits in this release.

Text Blocks Come to Java

Java 13 delivers long-awaited multiline strings.

Inside the Language: Sealed Types

How Java is moving toward pattern matching, improved enums, and better switch statements

Quiz Yourself: One-Dimensional Arrays (Intermediate)

The subtleties of using a constructor to create an array

Quiz Yourself: Custom Exceptions (Advanced)

When exactly do you need to declare an exception?

Quiz Yourself: Read and Set the Locale (Advanced)

For happy users, specify the locale correctly.