Java 8
About
1. Lambda Expressions
import java.util.*;
public class LambdaExample {
public static void main(String[] args) {
List<String> names = Arrays.asList("John", "Mary", "Peter", "Alice");
// Using lambda expression to sort the list
names.sort((s1, s2) -> s1.compareToIgnoreCase(s2));
System.out.println(names);
}
}2. Functional Interfaces and @FunctionalInterface Annotation
3. Default and Static Methods in Interfaces
4. Streams API
Example:
5. Method References
6. Optional Class
7. New Date and Time API (java.time package)
8. Collectors in Streams
9. forEach() Method in Iterable
10. computeIfAbsent() and computeIfPresent() in Map
11. String Joiner (java.util.StringJoiner)
12. Base64 Encoding and Decoding
13. Arrays.parallelSort()
Last updated