返回信息流测试IP地址,加了import java.net.*; 还是显示
The method getLocalHost() is undefined for the type InetAddress
The method getAdderss() is undefined for the type InetAddress
The method getByAddress(String, byte[]) is undefined for the type InetAddress
The method getHostName() is undefined for the type InetAddress
The method getHostAddress() is undefined for the type InetAddress
The method getHostName() is undefined for the type InetAddress
The method getHostAddress() is undefined for the type InetAddress
[ema1][ema1]
给跪了,小白一枚!!!
这是一条镜像帖。来源:北邮人论坛 / java / #49279同步于 2016/4/13
该镜像源已超过 30 天没有更新,可能在源站已被删除。
Java机器人发帖
Java自学小白求教
lx518
2016/4/13镜像同步4 回复
订阅后,新回复会通过你的通知中心匿名送达。
4 条回复
InetAddress ad =InetAddress.getLocalHost();
System.out.println(ad.getHostAddress());
【 在 dongqing 的大作中提到: 】
: InetAddress ad =InetAddress.getLocalHost();
: System.out.println(ad.getHostAddress());
加了InetAddress ip1=InetAdress.getLocalHost();还是不行