Java 11 Features

HTTP Client API

Java 11 introduced the standardized HTTP Client API (module java.net.http, package java.net.http) as part of JEP 321, replacing the legacy HttpURLConnection with a modern, flexible, and feature-rich API. It supports HTTP/1.1, HTTP/2, WebSocket, and both synchronous and asynchronous requests, eliminating the need for third-party libraries like Apache HttpClient for many use cases. Below is a …

HTTP Client API Read More »

New Methods in String Class

Java 11 introduced six new methods to the String class to enhance string manipulation, particularly with better Unicode support and streamlined operations.  isBlank() Purpose: Returns true if the string is empty or contains only whitespace characters (including Unicode whitespace), otherwise false. Use Case: Useful for validating input strings to check if they are effectively empty. …

New Methods in String Class Read More »

ZGC: A Scalable Low-Latency Garbage Collector

ZGC (Z Garbage Collector) is a scalable, low-latency garbage collector introduced in Java 11 (JEP 333) and production-ready in Java 15. Designed for applications requiring minimal pause times and handling large heaps (multi-terabyte), ZGC achieves pause times typically under 10ms, regardless of heap size, making it ideal for latency-sensitive systems. It’s enabled with -XX:+UseZGC. Key …

ZGC: A Scalable Low-Latency Garbage Collector Read More »

Epsilon: A No-Op Garbage Collector

Epsilon is a no-op garbage collector in Java (introduced in JEP 318, Java 11) that allocates memory but does not reclaim it, leading to a JVM crash with an OutOfMemoryError when the heap is exhausted. It’s enabled with -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC. Below, I’ll explain Epsilon briefly and provide a sample use case with code to demonstrate …

Epsilon: A No-Op Garbage Collector Read More »

Unicode 10 Support

Java 11, released in September 2018, includes support for Unicode 10.0.0, which was a significant update to the Unicode standard. Below is a concise overview of Unicode 10 support in Java 11 and its relevance as a feature: Unicode 10 Support in Java 11 Unicode Version: Java 11 supports Unicode 10.0.0, released in June 2017, …

Unicode 10 Support Read More »

Single-File Source-Code Programs

The Single-File Source-Code Programs feature, introduced in Java 11 via JEP 330, allows developers to execute a Java source file directly using the java launcher without explicitly compiling it first. This feature is particularly useful for beginners learning Java, writing small utility programs, or quickly testing code snippets. Important Points Purpose: Simplifies running single-file Java …

Single-File Source-Code Programs Read More »

Scroll to Top