这样就能编译通过了import java.net.*;
class InetAddressDemo
{
  public static void main(String[] args){
    String host="localhost";
    if(args.length==1)
      host=args[0];
     InetAddress ia = null;
     try{
       ia = InetAddress.getByName(host);
     }catch(Exception e){}
                    //是否正确?
     System.out.println("Canonical Host Name="+ia.getCanonicalHostName());//canonical 规则的
//ia是否没有getCanonicalHostName()的方法
     System.out.println("Host Address="+ia.getHostAddress());
     System.out.println("Host Name="+ia.getHostName());
     System.out.println("Is Loopback Address="+ia.isLoopbackAddress());//有isLoopbackAddress()方法吗?
    }
  }