Home » JAVA Programming » Networking » Question
  1. What happens if ServerSocket is not able to listen on the specified port?
    1. PortOccupiedException is thrown
    2. The system exits gracefully with appropriate message
    3. The system will wait till port is free
    4. IOException is thrown when opening the socket
    5. None of these
Correct Option: D

public ServerSocket() creates an unbound server socket.It throws IOException if specified port is busy when opening the socket.



Your comments will be displayed only after manual approval.