Example 4

package jdk8.byte_code;

import static jdk8.byte_code.Server.HttpServer;
import static jdk8.byte_code.WaitFor.waitFor;

public class Example4 {
    // lambda with arguments
    void example() throws InterruptedException {
        waitFor(new HttpServer(), (server) -> server.isRunning());
    }
}
Classfile Example4.class Last modified 08-May-2014; size 1414 bytes MD5 checksum 7177f97fdf30b0648a09ab98109a479c Compiled from "Example4.java" public class jdk8.byte_code.Example4 SourceFile: "Example4.java" InnerClasses: public static #21= #2 of #29; //HttpServer=class jdk8/byte_code/Server$HttpServer of class jdk8/byte_code/Server public static final #65= #64 of #67; //Lookup=class java/lang/invoke/MethodHandles$Lookup of class java/lang/invoke/MethodHandles BootstrapMethods: ...

Get Learning Java Lambdas now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.