Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { /***/ public static Thread[] createThreads(Runnable runnable, int threadCount) { Thread[] ret = new Thread[threadCount]; for (int i = 0; i < threadCount; i++) { ret[i] = new Thread(runnable); } return ret; } /***/ public static Thread[] createThreads(Runnable... runnables) { Thread[] ret = new Thread[runnables.length]; for (int i = 0; i < runnables.length; i++) { ret[i] = new Thread(runnables[i]); } return ret; } }