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");
    }
}

 

相关文章:

  • 2021-11-20
  • 2021-08-06
  • 2021-08-12
  • 2021-06-29
  • 2021-09-18
  • 2022-01-26
  • 2021-04-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-06
  • 2022-03-09
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
相关资源
相似解决方案