Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; public class ExecutordefaultThreadFactoryExample1 { public static void main(String[] args) { ThreadFactory thrdfctry = Executors.defaultThreadFactory(); Thread t = thrdfctry.newThread(new Mythrd()); t.start(); } } class Mythrd implements Runnable { @Override public void run() { System.out.println("Running thread concurrently"); } }
Output