Skip to content

Instantly share code, notes, and snippets.

@smamran
Last active Jun 5, 2016
Embed
What would you like to do?
Java 8 Thread Creation

Java 8 Thread Create

class Main
{
    public static void main(String args[])
    {
        Runnable task = () -> {
            String threadName = Thread.currentThread().getName();
            System.out.println(threadName);
        };
        task.run();
        Thread thread = new Thread(task);
        thread.start();
        System.out.println("Done!!");
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment