Language Enhancements:
var
in Lambda Expressions: Java 11 allows the use ofvar
keyword for local variable type inference in lambda expressions, improving readability and consistency.
2. New APIs:
String::isBlank()
: Checks if a string is empty or contains only whitespace characters.
String::strip()
: Removes leading and trailing whitespace, handling Unicode characters correctly.
String::lines()
: Returns a stream of lines from a string.Files::readString()
: Reads the entire content of a file into a string.HttpClient
: A new, asynchronous, and non-blocking HTTP client API supporting HTTP/1.1 and HTTP/2.Predicate::not()
: A static method that negates a predicate.
- New
toArray
method: A newtoArray
method in theCollection
interface that takes anIntFunction
argument for more convenient array creation.
No comments:
Post a Comment