Posts

Showing posts from August 19, 2016

Java 8 features (Lambda expression, Functional Method, Method Reference, Default Method for interface, Streams & Many more..)

Java 8 is the most powerful & rich update to java till now after java 5. Some of features are Lambda expression, Functional Method, Method Reference, Default Method for interface, Streams for Java along with some update for existing like Date time API, New Java script engine Nashorn to use latest features, optional classes & encoder.
I will try to explain one by and will keep it updated time to time as and when required.

New Date Time API
As java.util.date was not threadsafe & localisation zone was not difficult to handle so introduced
java.time.* APIS  enum chronounits in place of integer for date, day & month toInstant() for backword compaitibilty

Defaults Methods This capability is added for backward compatibility so that old interfaces can be used to leverage the lambda expression capability of Java 8. For example, ‘List’ or ‘Collection’ interfaces do not have ‘forEach’ method declaration. Thus, adding such method will simply break the collection framework implementations.…