Home » Tag Archives: Lambdas (page 3)

Tag Archives: Lambdas

Playing with Java 8 – Lambdas and Concurrency

java-logo

So Java 8 was released a while back, with a ton of features and changes. All us Java zealots have been waiting for this for ages, all the way back to from when they originally announced all the great features that will be in Java 7, which ended up being pulled. I have just recently had the time to actually ...

Read More »

Clean Synchronization Using ReentrantLock and Lambdas

java-logo

Recently I was reading an informative post about the differences between synchronized vs ReentrantLock by Javin Paul1. He emphasises on the advantages of the latter, but does not withhold some downsides, which are related to the cumbersome try-finally block needed for proper usage. While agreeing on his statements I brooded about a thought, that always bothers me when it comes ...

Read More »

Creating your own loop structure in Java 8 lambda

java-logo

Java doesn’t have an easy construct of repeat something N number of times. We can make a for loop of course, but many times we don’t even care about the variable that we created in the loop. We just want repeat N times of some code and that’s it. With the lambda available in Java 8, you may attempt something ...

Read More »

The Dark Side Of Lambda Expressions in Java 8

java-logo

This post may not make me any new friends. Oh well, I was never really popular at school anyway. But let’s get to the point. Java 8’s biggest feature in terms of the language is undoubtedly Lambda expressions. It’s been a flagship feature for functional languages such as Scala and Clojure for a few years, and now Java has finally joined ...

Read More »

Simplifying ReadWriteLock with Java 8 and lambdas

java-logo

Considering legacy Java code, no matter where you look, Java 8 with lambda expressions can definitely improve quality and readability. Today let us look at ReadWriteLock and how we can make using it simpler. Suppose we have a class called Buffer that remembers last couple of messages in a queue, counting and discarding old ones. The implementation is quite straightforward: ...

Read More »

Java 8 Released! — Lambdas Tutorial

javafx-logo

To celebrate the release of Java 8 which was released just minutes ago, I am publishing a draft version of my Java 8 Lambdas Tutorial.  It is a nice visual way to learn the Streams API, and will help you get started taking advantage of lambdas in your own applications from day 1.  This article is scheduled to appear in ...

Read More »

Java 8: Lambda Expressions vs Auto Closeable

java-logo

If you used earlier versions of Neo4j via its Java API with Java 6 you probably have code similar to the following to ensure write operations happen within a transaction:                   public class StylesOfTx { public static void main( String[] args ) throws IOException { String path = "/tmp/tx-style-test"; FileUtils.deleteRecursively(new File(path)); GraphDatabaseService ...

Read More »

Playing with Java 8 Lambdas in the JDT

eclipse-logo

I’ve been playing with the language a bit while tinkering with the Java 8 support under development by the Eclipse Java development tools (JDT) project. I’ll admit that I’m a little underwhelmed by lambdas in Java 8. This, of course, comes from an Old Dude Who Knows Smalltalk (and LISP/Scheme). Like any good Smalltalk curmudgeon, when I set about learning ...

Read More »

Java 8: Compiling Lambda Expressions in The New Nashorn JS Engine

java-logo

In a recent post I took a look at how Java 8 and Scala implemented Lambda expressions. As we know Java 8 is not only introducing improvements to the javac compiler, It’s also introducing a new one altogether – Nashorn. This new engine is meant to replace Java’s existing JavaScript interpreter Rhino. This is supposed to bring the JVM to ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close