It calls ThreadFactory . Take a look at the Executors class. Note that they all have an overloaded argument, where you can provide an implementation of ThreadFactory . ThreadFactory interface basically
public Thread newThread(Runnable runnable);
and the default implementation, if not supplied, is basically just return new Thread(runnable);
Why redefine this - well, it is very useful for customizing the topic name and daemon status, among other things.
source share