[Chapter 15] UnknownHostException

#

| Chapter 15 The java.net Package |

# UnknownHostException

## Name

UnknownHostException

## Synopsis

Class Name:

  `java.net.UnknownHostException`

Superclass:

  `java.io.IOException`

Immediate Subclasses:

  None

Interfaces Implemented:

  None

Availability:

  JDK 1.0 or later

## Description

A `UnknownHostException` is thrown when a hostname cannot be resolved to an IP address.

## Class Summary

    public class java.net.UnknownHostException extends java.io.IOException {
      // Constructors
      public UnknownHostException();
      public UnknownHostException(String host);
    }

## Constructors

### UnknownHostException

#### public UnknownHostException()

Description

  This constructor `create`s an `UnknownHostException` with no associated detail message.

#### public UnknownHostException(String host)

Parameters

  `host`

    The detail message.

Description

  This constructor creates an `UnknownHostException` with the specified detail message, which should be the hostname that cannot be resolved.

## Inherited Methods

Method | Inherited From | Method | Inherited From
--- | --- | --- | ---
`clone()` | `Object` | `equals(Object)` | `Object`
`fillInStackTrace()` | `Throwable` | `finalize()` | `Object`
`getClass()` | `Object` | `getLocalizedMessage()` | `Throwable`
`getMessage()` | `Throwable` | `hashCode()` | `Object`
`notify()` | `Object` | `notifyAll()` | `Object`
`printStackTrace()` | `Throwable` | `printStackTrace(PrintStream)` | `Throwable`
`printStackTrace(PrintWriter)` | `Throwable` | `toString()` | `Throwable`
`wait()` | `Object` | `wait(long)` | `Object`
`wait(long, int)` | `Object` |  |

## See Also

`Exception`, `IOException`, `RuntimeException`

URLStreamHandlerFactory |  | UnknownServiceException