One Java
One Java
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 java.net.*;
import java.io.*;
import java.util.Scanner;
Socket mySocket;
public Server(Socket s) {
mySocket = s;
}
while(true) {
Socket s = ss.accept();
Server newServer = new Server(s);
newServer.start();
}
} catch(IOException e) {}