I want to throw an exception that when a user enters an invalid IP address, host name or not a fully qualified domain name it'll bring up an error message.
I'm not too sure whether to use unknownhostexception or IOException.
I tried doing if statement but I don't know what 'invalid' can be in java.
If (addr != ' not a valid IP address, host name, fully qualified domain name or entered something invalid ')
{
throw new IOException/UnknownHostException("this is invalid: " + addr); }
Can anyone help please? Thanks in advance.