O'Reilly logo

Java™ Network Programming and Distributed Computing by Michael Reilly, David Reilly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

3.4. Internet Addressing with Java

By now it should be clear that a host on the Internet can be represented either in dotted decimal format as an IP address, or as a hostname such as ftp.davidreilly.com. Under Java, such addresses are represented by the java.net.InetAddress class. This class can fill a variety of tasks, from resoling an IP address to looking up the hostname. In the next section, this important class is examined in detail.

3.4.1. The java.net.InetAddress Class

The InetAddress class is used to represent IP addresses within a Java networking application. Unlike most other classes, there are no public constructors for that of InetAddress. Instead, there are two static methods that return InetAddress instances. Those and the other ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required