I was browsing through the Amazon.com Bookstore and I came across the book "Functional Programming for Java Developers". 

I know some very basic Functional Programming and have been programming in Java for 3 years. 

I would like to know is Functional Programming even possible in Java?

It depends what you mean by "functional programming" and by "possible".

You can obviously implement things following a functional paradigm. However the Java language doesn't provide the syntactic sugar for it, so some things will be tedious at best, and some other ones will be extremely arcane.

Similarly, you can very well write object-oriented code in a language recognized as being non-OO, like C.

Java Libraries

There are libraries that can help you do this, by already doing the legwork for you and hiding the arcane things:


mature/established libraries:


Functional Java
Google guava
LambdaJ

more obscure/experimental libraries:


Fun4J (also comes with a lisp to bytecode compiler)
JCurry
OCaml-Java
Jambda
Bolts
Functional Java (swensen.functional)



These will allow you to write Java code with a more functional approach and possibly more familiar syntax and semantic, as you'd expect from an FP-competent language. Within reason, that is.

JVM Languages

And obviously, you can implement a functional language on top of Java. So that you can then use that one as your FP language. Which is a bit of a higher-level of abstraction than what you asked for, but relatively within context (though I'm cheating a bit here, granted).

For instance, check out:


quite mature languages:


Clojure
Scala

less mature or active / more obscure languages:


Haskell-based:


Frege
Jaskell

Scheme-based:


Bigloo (targets R5RS)
Kawa (targets R6RS)
SISC (targets R5RS)
JScheme (targets R4RS)

ML-based:


Yeti




More-or-Less Functional JVM Languages

While they may not be exactly what you want, there are a number of other languages that have been ported to the Java Platform and that might free you from Java's relatively not so fun-oriented (yes, pun intended) nature and already give you more flexibility. Notable contenders like JRuby, Jython and Rhino (respectively for Ruby, Python and JavaScript / ECMAScript) also offer interesting potential for functional programming, though they arguably aren't really functional programming languages by nature. JetBrains' Kotlin, while clearly acknowledging it isn't a functional language, does support some functional constructs and is also worth a look.

Further Reading

You may also want to read or watch these articles or videos:


Functional Progamming in the Java Language, IBM DeveloperWorks (2004)
Functional Programming Java, Lambda the Ultimate (2004)
Functional Programming: a Pragmatic Introduction, InfoQ/CodePalousa (2011)
and related StackOverflow questions like this one

