一个很简单的找出自己IP地址的java code
import java.net.*;
class getIpAddress{
public static void main(String[]args){
try{
System.out.println(InetAddress.getLocalHost());
}
catch(UnknownHostException e){
System.out.println(e.toString());
}
}// End main
}//End class
class getIpAddress{
public static void main(String[]args){
try{
System.out.println(InetAddress.getLocalHost());
}
catch(UnknownHostException e){
System.out.println(e.toString());
}
}// End main
}//End class