在Java中,获取主机名可以使用下面哪个方法

在Java中,获取主机名可以使用下面哪个方法

A.getHostName()

B.getLocalHost()

C.getByName()

D.getHostAddress()

正确答案是A