package javanet;
import java.net.InetAddress;
import java.net.UnknownHostException;
public class demo1 {
/*
* 这里讲的TCP UDP只是用于局域网,如果是互联网,那么还是需要更进一步的学习才行
*/
public static void main(String[] args) {
try {
InetAddress ia = InetAddress.getByName("www.taobao.com");
String address = ia.getHostAddress();
P(address);
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void P(String s){
System.out.println(s);
}
}