标签:address port bsp code pre exception add system nbsp
package sdfg; import java.net.InetAddress; //import java.net.UnknownHostException; import java.io.*; public class sdfg { public static void main(String[] args) throws IOException { String domain="www.google.com"; FileWriter fw=new FileWriter("add.txt"); InetAddress[] arr=InetAddress.getAllByName(domain); for(int i=0;i<arr.length;i++) { System.out.println(arr[i]); fw.write(arr[i].toString()+‘\n‘); } fw.close(); System.out.println("end"); } }
标签:address port bsp code pre exception add system nbsp
原文地址:http://www.cnblogs.com/tiandsp/p/7467829.html