Java 11 – Removed/Deprecated APIs

Java 11 has removed selected deprecated APIs. Following is the list of removed APIs. Java EE and CORBA Following deprecated Java EE and CORBA are removed from Java 11 release. Java API for XML-Based Web…

Java 11 – Nested Based Access

Java 11 introduced a concept of nested class where we can declare a class within a class. This nesting of classes allows to logically group the classes to be used in one place, making them…

Java 11 – Var in Lambda

Java 11 allows to use var in a lambda expression and it can be used to apply modifiers to local variables. Consider the following program − Limitations There are certain limitations on using var in…

Java 11 – Not Predicate

Java 11 introduced new method to Predicate interface as not() to negate an existing predicate similar to negate method. Consider the following program − Java11NotPredicate.java Output

Java 11 – Optional Class

Java 11 introduced new method to Optional class as isEmpty() to check if value is present. isEmpty() returns false if value is present otherwise true. It can be used as an alternative of isPresent() method…

Java 11 – String API

Java 11 introduced multiple enhancements to String. String.lines() − Return the stream of lines of multi-line string. String.strip() − Removes the leading and trailing whitespaces. String.stripLeading() − Removes the leading whitespaces. String.stripTrailing() − Removes the trailing whitespaces. String.repeat(int) − Repeats…

Java 11 – File APIs

Java 11 introduced an easy way to read and write files by providing new overloaded methods without writing much boiler plate code. Consider the following example − Java11Files.java Output