是否应当像这里那样,在班级建筑商内建立一线并称之为开端方法?
public class Server implements Runnable {
private ServerSocket server;
public Server(int port) {
try {
//Opens a new server
server = new ServerSocket(port);
} catch (IOException ioe) {
ioe.printStackTrace();
}
new Thread(this, "Server").start();
}
@Override
public void run() {
}
}