For instance, after a HttpResponse is returned from a web server, I check the status code: if failure, then run failure method, else run success method. I can do that with an if statement. Using an if statement means that I have to query the status code. I can also do it with a Consumer and Runnable: onSuccess(action, otherwise). The status code still gets checked, but now that gets done in the appropriate place: the response checks it, or the code checks itself.
The #Java #programming #language of course has a long history with passing #Runnables into #thread runners and executors. We see it all over the place in #Swing and #JavaFX. It just always felt clunky to me. And that feeling got lifted, mostly, with Java gaining #lambdas.
I remember when my #CSharp colleagues first introduced me to the concept of lambdas. We were very excited.
May the remaining limitations Java imposes on lambdas get lifted soon!
Server run by the main developers of the project It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!