Features:
Below mentioned are few features in java 8:
1. Lambda Expressions
2. Functional Interfaces (type to call lambda expressions)
3. Default methods in interfaces (we can declare concrete methods here) 1.8 version onwards
4. Static methods in interfaces (also static inside interfaces) 1.8 version onwards
5. Predicate is predefined functional interface
6. Function is predefined functional interface
7. Consumer is predefined functional interface
8. :: was in c++, but now in Java 8 with different purpose which is method reference and constructor reference.
9. Stream API :(Most Imp) to perform bulk operation on collection becomes very easy. More readable and concise code in a single line instead of 6 lines.
10. Date and time API : -- Introduced by joda.org-- Also known as Joda API
Purpose of java 8 features:
- To simplify programming.
- To enable/utilise functional programming benefits in Java in the form of Lambda expression.
- To enable parallel programming/processing in java.I can write more compatible code which is going to run on multi core systems. (overall performance is going to be improves).
No comments:
Post a Comment