Android supported Java8 features

  • default and static methods in Interfaces
    • default and static methods can be declared in Interfaces declarations. These methods don't need to be implemented by the Classes that are implementing those interfaces. static methods are attached to the Interface and Classes which implements such interfaces.
    • Reference:
  • Repeating Annotations
    • Now one annotation can be used multiple times on a specific target.
    • Reference:
  • Lambda expressions:
    • Lambda expressions enable to treat functionality as method argument or code as data.
    • Lambda exp is useful especially to define anonymous class with one method
    • Reference:
    • Syntax for Lambda expressions:

  • Functional interfaces: An interface with only method is called as functional interfaces. JDK defines few built-in functional interfaces in package: java.util.function 

No comments:

Post a Comment

Scheduling Repeating Local Notifications using Alarm Manager

Learn about Scheduling Repeating Local Notifications using Alarm Manager in this post .