Junior — Middle
Tell us about your experience using Java 11 in projects.
sobes.tech AI
Answer from AI
In my experience working with Java 11, I utilized the new features of this version to improve code readability and performance.
For example:
- Using
varfor local variables, which reduces boilerplate code and enhances comprehension. - New methods in the API, such as
String::isBlank,Optional::isEmpty. - Improvements in working with collections and streams.
- Using the HTTP Client API from Java 11 for convenient HTTP request handling.
An example of using var and the new HTTP client:
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
.uri(URI.create("https://example.com"))
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
Java 11 allowed writing more concise and modern code, which positively affected development productivity.