我得到了固定數量的線程。我希望每個線程都能一個接一個地運行三個Runnable。下面是一些僞代碼來解釋: Thread[] threads = new Thread[4];
for (int i = 0; i < threads.length; i++) {
// Set the first tasks.
threads[i] = new Thread(new FirstR
InputStream in = ClientSocket.getInputStream();
new Thread()
{
public void run() {
while (true)
{
int i = in.read();
handleInput(i);
}
}
}.start();
我在聽新的