public static boolean isValidNetmask(String netmask)
	{
		try
		{
			return isValidNetmask(InetAddress.getByName(netmask));
		}
		catch (UnknownHostException e)
		{
			return false;
		}
	}
public static boolean isValidNetmask ( String netmask ) { try { return isValidNetmask ( InetAddress . getByName ( netmask ) ) ; } catch ( UnknownHostException e ) { return false ; } }
Validates a netmask

@param netmask
String A netmask to test

@return boolean True if it validates, otherwise false