Multiple choice

Which of the following methods of InetAddress class returns a string that represents the host address associated with the InetAddress object?

  1. getaddress()

  2. getHostAddress()

  3. getHostName()

  4. hashCode()

  5. toString()

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

This method of InetAddress class returns a string that represents the host address associated with the InetAddress object.