Java Lambda

I have only lean pickings especially during this recession. But this is my first Java Lambda. I have worked with Clojure in the past and I can relate to that.

There is enormous power in lambda’s and I hope to explore it further.

package com.test.lambda;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;

public class Lambda {

  /* @param args*/
 
  public static void main(String[] args) {

    Runnable r = () -> System.out.println("Test Lambda");
    ExecutorService executor = Executors.newFixedThreadPool(2);
    executor.execute(r);
    executor.shutdown();
  }
}

Compiled with
openjdk version “1.8.0-ea”
OpenJDK Runtime Environment (build 1.8.0-ea-lambda-nightly-h3207-20130205-b76-b00)
OpenJDK 64-Bit Server VM (build 25.0-b15, mixed mode)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: