how to understand this interface Executor example in Java API docs [closed]

Can anyone help to explain this piece of code in details? class SerialExecutor implements Executor { final Queue tasks = new ArrayDeque(); final Executor …

Impossible to make a cached thread pool with a size limit?

It seems to be impossible to make a cached thread pool with a limit to the number of threads that it can create. Here is how static Executors.newCachedThreadPool is implemented in the standard Java …

Executors.newCachedThreadPool() versus Executors.newFixedThreadPool()

newCachedThreadPool() versus newFixedThreadPool() When should I use one or the other? Which strategy is better in terms of resource utilization?