COMP 310
|
Java 8 New Features
|
|
Under Construction!
References:
Highlights
Java Language Enhancements
Ref:
Oracle: Enhancements in Java SE 8
- Lambda Expressions:
- Method references
default
methods in interfaces
- Enable new functionality to be added to
the interfaces of libraries and ensure binary compatibility with code
written for older versions of those interfaces.
- Automatically gives a default behavior if the interface
implementation does not explicitly declare the method
- Is equivalent to using an intermediate abstract class that
provides a default, overridable implementation for its subclasses
where all implementations share the same default behavior
-- not something one always wants!
- Default functionality can only involve staticly-accessible
values or references. Using an intermediate
abstract class allows access to instance-accessible
values/references.
- Can override a
default
method in an implementation.
static
methods in interfaces
- Enable invariant functionality/behavior across all implementations
- Cannot be overridden!
- Repeating Annotations provide the ability to apply the same annotation
type more than once to the same declaration or type use.
- Type Annotations provide the ability to apply an annotation anywhere a
type is used, not just on a declaration. Used with a pluggable type system,
this feature enables improved type checking of your code.
- Method parameter reflection.
Collections
Security
JavaFX
© 2017 by Stephen Wong