Describe the code

Report a typo

Here is a fragment of code. We skipped some lines to simplify it:

try (ServerSocket server = new ServerSocket(PORT)) {
    while (true) {
        try (
            Socket socket = server.accept(); // accept a new client
            DataOutputStream output = new DataOutputStream(socket.getOutputStream())
        ) {
            output.writeUTF("Hello!"); // send a message to the client
        }
    }
} catch (IOException e) {
    e.printStackTrace();
}

Describe this code by selecting all applicable statements.

Select one or more options from the list
___

Create a free account to access the full topic