answersLogoWhite

0

It is a class in Java which represents an internet Protocol (IP) address. An instance of an InetAddress consists of an IP address and possibly corresponding hostname.

The Class represents an Internet address as Two fields:

1- Host name(The String)=Contain the name of the Host.

2- Address(an int)= The 32 bit IP address.

This fields are not public, so we cant Access them directly.

There is not public constructor in InetAddress class, but it has 3 static methods that returns suitably initialized InetAddress Objects.

public String getHostName()

public byte[] getAddress()

public String getHostAddress()

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Computer Science