Quick Overview on Java 8 Features

android_development

After all we have some features of java 8 on android :D, lets look at them.

Default Methods

Default methods enable us to add new functionalities to interfaces without breaking the classes that implements that interface (For more information please check this link).

Important Note: This feature just work on API level 24.

Static Methods

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.

Important Note: This feature just work on API level 24

Repeating Annotations

There are some situations where you want to apply the same annotation to a declaration or type use. Repeating annotations enable you to do this.

Important Note: This feature just work on API level 24

Lambda Expressions

Lambda expression facilitates functional programming, and simplifies the development a lot.
Important characteristics of a lambda expression:

  • Optional type declaration
  • Optional parenthesis around parameter
  • Optional curly braces
  • Optional return keyword

This feature is available on API level 24 and lower.

Method References

You use lambda expressions to create anonymous methods. Sometimes, however, a lambda expression does nothing but call an existing method. In those cases, it’s often clearer to refer to the existing method by name.

This feature is available on API level 24 and lower.

 

lambda

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s