> 1. Is Functional Programming really necessary in Java 8?
I think so. We've been programming with imperative style for way too long in Java.
Declarative style, expressiveness are some of the things that attracted me to other languages in the first place.
It is nice that we can create code with some of those very capabilities in Java. Those of us using Java don't
have to be deprived of those features any more.
> 2. Can you illustrate the advantages and pitfalls when coding in Java 8 using Functional Programming ?
I have mentioned some advantages in other posts, I will mention some of the pitfalls here.
Java has predominantly been imperative, OO, mutable state (or shared mutable state). FP is declarative and favors immutability.
We should use extra caution not to mix mutability, shared state, and functional style. The language offers a thin layer of protection,
but it's not hard to breach that. As programmers we should refrain from that temptation to mix these paradigms in an unhealthy manner.
> 3. Why do we need a transformation from old way of coding to Functional Programming ?
I touched on some of these here: Why FP
>4. Can you illustrate Functional Programming in Java 8 with a working example. ?
There are several examples out there, instead of repeating it here, if you would, please take a look at one example here:
Presentation from SpringOne2GX on Java 8