por que o codigo abaixo não funciona ?
/**
*
* @date 29/03/2013
*
*/
public class Sp implements Runnable {
/**
* Construtor
*/
public Sp() {
}// end of constructor
@Override
public void run() {
System.out.println("nome " + Thread.currentThread().getName());
}// end of run
}// end of class
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
*
* @date 29/03/2013
*
*/
public class TesteNome {
private final int THREADS = 5;
/**
* Construtor
*/
public TesteNome() {
// cria o pool de threads
ExecutorService executor = Executors.newFixedThreadPool(THREADS);
// cria as threads e insere no pool
int i = 0;
for (i = 0; i < THREADS; i++) {
Thread t = new Thread(new Sp(), "Sp-" + i);
executor.execute(t);
}// for
executor.shutdown();
}// end of constructor
/**
* @param args
*/
public static void main(String[] args) {
new TesteNome();
}// end of main
}// end of class
porque a saida é
nome pool-1-thread-2
nome pool-1-thread-4
nome pool-1-thread-1
nome pool-1-thread-3
nome pool-1-thread-5
e não
nome Sp-2
nome Sp-4
nome Sp-1
nome Sp-3
nome Sp-5
onde esta o erro ?