Here you can find the source of exec(Runnable... commands)
public static void exec(Runnable... commands)
//package com.java2s; //License from project: Open Source License import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; public class Main { private static ExecutorService pool = Executors.newCachedThreadPool(); public static void exec(Runnable... commands) { if (commands.length > 0) { for (Runnable runnable : commands) { pool.execute(runnable);// w w w . j a v a 2s . co m } } } }