The Socket() constructors do not just create a Socket object. They also attempt to connect the underlying socket to the remote server.
Socket()
All the constructors throw an IOException if the connection can't be made for any reason.
IOException