String name = "XXXXXX";InetAddress address=InetAddress.getByName(name); 注意InetAddress address=InetAddress.getByName(name);方法有异常,需要用try,catch包住