Sunday, 30 July 2017

1. Why java 8

1. Why java 8?
  1. Performance improvements in common data structures.
  2. Fork/Join speed improvements.
  3. Changes to support concurrency.
  4. Lambda expressions, the Streams API, and new methods on existing classes are some of the key productivity improvements.
  5. New Optional type gives developers significant flexibility when dealing with null values, reducing the likelihood of NullPointerExceptions.
  6. Garbage Collector Improvements.
  7. Easy to Parallelize.

2. What are the new features of java 8?
  1. Lambda expressions.
  2. Functional Interfaces.
  3. Method references.
  4. Methods inside interface.
  5. Java inbuilt functional interfaces.
  6. Streams.
  7. Date & Time (Joda API).


3. Functional Programming (FP) vs Object Oriented Programming (OOP)?
OOP :
  1. OOP is most successful programming approach.
  2. Object contains ‘State’ and ‘Behaviour’, State is variables and Behaviour is methods.
  3. OOP it tightly couples the state and behaviour of object together.
  4. Data (state) of the object will be updated by the methods(behaviour) of the object.
FP :
  1. Idea behind the FP is mathematics, Functional Programming is a form of programming which considers computation as an evaluation of mathematical functions.
  2. The foundation for functional Programming is Lambda Calculus. Lambda calculus was developed in 1930s to be used for functional definition, functional application and recursion in mathematics.
  3. LISP was the first functional programming language. It was defined by McCarthy in 1960.
  4. Lisp is predominantly used in the area of Artificial intelligence and as a macro language on top of softwares like AutoLISP for AutoCad and elisp for emacs.
  5. It avoids the changing of data, the data is immutable.
  6. Some inputs are transformed to outputs without modifying input data.
  7. FP supports parallel processing by multi core support.

4. Is java 8 is a Functional Programming language ?
  1. JVM languages like scala, clojure and frameworks like guava supports functional programming, and mostly used in data processing like hadoop.
  2. By inspiring those languages Java 8 is trying transforming into functional programming support along with OOP.

5. Official documentation of Java 8


No comments:

Post a Comment

3. Java Program to create Binary Tree