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 »

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