O'Reilly logo

JavaBeans Unleashed by Rick Leinecker, Dr. Donald Doherty

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

Using Internet Addresses

Internet addresses, also known as IP addresses, are fundamental to Internet communication. You encapsulate IP addresses in InetAddress objects using Java's InetAddress class. That is, each InetAddress object encapsulates the IP address of a particular host computer. The InetAddress class is part of the java.net package.

The InetAddress class is unusual in that it doesn't provide public constructors. You create InetAddress objects by using one of three InetAddress class methods: getByName(), getAllByName(), and getLocalHost().

You will probably find yourself using the InetAddress class's getByName() method most of the time. The getByName() method is declared as follows:

 public static InetAddress getByName(String host) ...

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