Can you tell me some new features that were introduced in Java 11?

Java 11 is a Long-Term Support (LTS) release that introduced several enhancements focused on performance, modern APIs, developer productivity, and JVM improvements. It added a new HTTP Client API, new garbage collectors, String utility methods, and various language enhancements that made Java applications more efficient and easier to develop.

Key Points

Major Features Introduced in Java 11

1. HTTP Client API

A new standardized HTTP Client API was added to replace the older HttpURLConnection API.

Benefits

Example

HttpClient client = HttpClient.newHttpClient();

2. Local-Variable Syntax for Lambda Parameters

Java 11 allows the use of var in lambda parameters.

Example

(var name) -> name.toUpperCase()

Benefits

3. New String Methods

Java 11 introduced several useful String utility methods.

isBlank()

Checks whether a string contains only whitespace.

Example

"   ".isBlank();

strip()

Removes leading and trailing Unicode whitespace.

Example

" Java ".strip();

stripLeading()

Removes whitespace from the beginning.

Example

" Java".stripLeading();

stripTrailing()

Removes whitespace from the end.

Example

"Java ".stripTrailing();

repeat()

Repeats a string multiple times.

Example

"Java".repeat(3);

Output

JavaJavaJava

4. Files Utility Enhancements

A new method was introduced to read file content directly into a String.

Example

String content = Files.readString(path);

Benefits

5. Epsilon Garbage Collector

A no-op garbage collector that does not reclaim memory.

Benefits

6. Z Garbage Collector (ZGC)

A scalable, low-latency garbage collector designed for large heap sizes.

Benefits

7. Running Single-File Java Programs

Java source files can be executed directly without explicit compilation.

Example

java Hello.java

Benefits

Example

Using one of the new String methods introduced in Java 11.

public class Demo {

    public static void main(String[] args) {

        String text = "Java ";

        System.out.println(text.repeat(3));
    }
}

Output

Java Java Java

Benefits of Java 11 Features

Interview Tip

A concise interview answer is

Some important features introduced in Java 11 include the new HTTP Client API, Local-Variable Syntax for Lambda Parameters, Epsilon Garbage Collector, Z Garbage Collector, Single-File Source-Code Execution, Files.readString(), and new String methods such as isBlank(), strip(), stripLeading(), stripTrailing(), and repeat(). Java 11 is also a Long-Term Support (LTS) release widely used in enterprise applications.

Last updated: 16 July 2026

Previous question: What is the difference between filter() and map() in the Stream API?

Next question: Can you tell me some new features that were introduced in Java 17?

More Core Java - Level II interview questions

All Core Java - Level II questions