Posts

Showing posts with the label Java Features for Developers

Java 11 Features: What Every Developer Should Know

Java 11 Features: What Every Developer Should Know Java 11, released in September 2018, marked the second Long-Term Support (LTS) version after Java 8. It brought several key improvements and changes that every Java developer should be aware of. Whether you're upgrading from Java 8 or just curious, here’s a rundown of the most impactful features. 1. var in Lambda Parameters Java 11 allows the use of var in lambda expressions: (list) -> list.size() // Old (var list) -> list.size() // Java 11 This is particularly useful when annotations are required: (@Nonnull var item) -> System.out.println(item); 2. HTTP Client (Standard) Java 11 standardized the HTTP Client API introduced in Java 9. It supports HTTP/1.1 and HTTP/2 and replaces the older HttpURLConnection . HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://...