-
What happens if ServerSocket is not able to listen on the specified port?
-
- PortOccupiedException is thrown
- The system exits gracefully with appropriate message
- The system will wait till port is free
- IOException is thrown when opening the socket
- 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.