Example 5

package jdk8.byte_code;

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

public class Example5 {

    // closure
    void example() throws InterruptedException {
        Server server = new HttpServer();
        waitFor(() -> !server.isRunning());
    }
}
Classfile Example5.class Last modified 08-May-2014; size 1470 bytes MD5 checksum 7dd0f577d4b4b903500264acf9649c30 Compiled from "Example5.java" public class jdk8.byte_code.Example5 SourceFile: "Example5.java" InnerClasses: public static #31= #2 of #29; //HttpServer=class jdk8/byte_code/Server$HttpServer of class jdk8/byte_code/Server public static final #68= #67 of #70; //Lookup=class java/lang/invoke/MethodHandles$Lookup of class java/lang/invoke/MethodHandles BootstrapMethods: ...

Get Learning Java Lambdas now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.