MCQs City stays free thanks to ads. Please turn off your ad blocker for this site so content and features keep working.
Computer Networks
Computer Networks Assessment
Q
In Inet Address class, which method returns the host name of the IP Address?
AA. Public string get hostname()
BB. Public string gethostaddress()
CC. Public static inetaddress get localhost()
DD. Public getbyname()
Correct Answer:
A. A. Public string get hostname()
Explanation:
In Inet Address class public String getHostname() method returns the host name of the IP Address. The getHostAddress() method returns the IP address of the given host name.