I would like to share my exprience. I find at
java.net.InetAddress ,class InetAddress has a method called
getByname(); so we can get the Ip address by its host
name. For example ,InetAddress
address=InetAddress.getByname("localhost"). and the value of address is
"127.0.0.1".