New Features in Java 11 Explained in Detail
Java 11, is the latest long-term support (LTS) version of the Java programming language. It brings along several exciting features and improvements. In this blog post, we’ll take high level look into the New Features in Java 11. Local Variable Syntax for Lambda Parameters One of the most important features in Java 11 is the ability to use the var keyword for lambda parameters. This allows for more concise and readable code when working with lambda expressions. Java 10 introduced the Local Variable Type Inference feature . However, the var keyword could not be used with lambda expressions. So, you would need to write a lambda expression as follows: (int a, int b) -> a + b This code can be rewritten in Java 11 as follows: (var a, var b) -> a + b HTTP Client Improvements Java 11 introduces a new and modern HTTP client API that supports HTTP/1.1, HTTP/2, and WebSocket. This new client offers a more flexible and efficient way to make HTTP requests and process responses. It’s fully