1 byte add[] = {131, 170, 40, 30}; //IP地址字节数组2 //由IP地址创建InetAddress类对象3 InetAddress someIA = InetAddress.getByAddress(add);4 //获取并输出someIA对象的计算机名称5 System.out.println("IP地址为64.124.117.19的计算机名称:" + someIA.getHostName());在用NetBean编写Java的main method中,如果将byte改为int,则违反了static InetAddress getByAddress(byte[] addr)这一原则
添加回答
举报
0/150
提交
取消