3. Other Improvement (Not Covered Here)
Collections
Security
JavaFX
Tools
Internationalization
Scripting
IO and NIO
● java.lang and
java.util
● Networking
● Concurrency
4. New Features in The Language
lambda functions
method references
default methods
static methods (in interfaces)
5. Lambda Expressions
Lambda expressions are applicable only to
functional interfaces.
“A functional interface is any interface that
contains only one abstract method.”
“You can consider lambda expressions as
anonymous methods - methods without a
name.”
10. Default Method. Options for
Implementing class
Not mention the default method at all, which
lets your extended interface inherit the
default method.
Redeclare the default method, which makes it
abstract.
Redefine the default method, which overrides
it.
11. Static Method. Definition
“A static method is a method that is associated
with the class in which it is defined rather than
with any object. Every instance of the class
shares its static methods.” - Oracle
Useful to keep interface-related method in…
the interface itself!
12. Aggregate Operations
Stream is a sequence of elements supporting
sequential and parallel aggregate operations.
A pipeline is a sequence of aggregate
operations.
14. Aggregations vs Iterators
Aggregation Iterators
Internal iteration External iteration
Parallel iteration Sequential iteration
Works with stream Works with collection
Accept lambda parameters -
16. Parallel Stream Pitfalls
Single ForkJoinPool is used by default.
Do not use stateful lambdas.
Source of the stream may never be modified
in pipeline.
Use with extreme care in container
environment (e.g. in EE).
18. Date-Time Classes overview
DayOfWeem and Month enums
Dates: LocalDate, YearMonth, MonthDay, Year
Date & Time: LocalTime, LocalDateTime
Time zones: ZoneId, ZoneOffset,
ZonedDateTime, OffsetDateTime, OffsetTime
Instant
Period and Duration
19. Compact Profiles. Summary
The problem - the size of JRE is huge and
growing.
Target - modularization of JRE.
Work started as Project Jigsaw.
Java 8 brings compact profiles.
Full modularization planned for Java 9.
21. Metaspace Highlights
Reduced amount of class metadata
Limited by amount of native memory (by
default)
Per-class loader spaces
Improved full collection time
Huge improvement potential in Java 9 :)
22. AES on CPU
Enabled by default
-XX:+UseAES -XX:+UseAESIntrinsics
-XX:-UseAES -XX:-UseAESIntrinsics
Works only on some Intel CPU’s
(manufactured in 2010 or later)
Does no work on AMD CPU’s
Editor's Notes
in other place the compiler can’t determine lambda type