Multithreaded Java Application Example
Multithreaded Java Application Example
java Página 1 de 1
/* class One creates ten "printing" threads that print all to the console */
class One extends Thread {
String whatToPrint;
public One(String s) { whatToPrint = s; }
import [Link].*;
import [Link].*;
import [Link];
Socket mySocket;
public Server(Socket s) {
mySocket = s;
}
while(true) {
Socket s = [Link]();
Server newServer = new Server(s);
[Link]();
}
} catch(IOException e) {}