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.
1. HTTP Client API
A new standardized HTTP Client API was added to replace the older HttpURLConnection API.
HttpClient client = HttpClient.newHttpClient();
2. Local-Variable Syntax for Lambda Parameters
Java 11 allows the use of var in lambda parameters.
(var name) -> name.toUpperCase()
3. New String Methods
Java 11 introduced several useful String utility methods.
isBlank()
Checks whether a string contains only whitespace.
" ".isBlank();
strip()Removes leading and trailing Unicode whitespace.
" Java ".strip();
stripLeading()Removes whitespace from the beginning.
" Java".stripLeading();
stripTrailing()Removes whitespace from the end.
"Java ".stripTrailing();
repeat()Repeats a string multiple times.
"Java".repeat(3);
JavaJavaJava
4. Files Utility Enhancements
A new method was introduced to read file content directly into a String.
String content = Files.readString(path);
5. Epsilon Garbage Collector
A no-op garbage collector that does not reclaim memory.
6. Z Garbage Collector (ZGC)
A scalable, low-latency garbage collector designed for large heap sizes.
7. Running Single-File Java Programs
Java source files can be executed directly without explicit compilation.
java Hello.java
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));
}
}Java Java Java
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?