?? address.java
字號:
import java.net.*;
public class Address {
public static void main(String[] args) {
try {
InetAddress me = InetAddress.getLocalHost();
System.out.println(me);
System.out.println("My name is " + me.getHostName());
System.out.println("My address is " + me.getHostAddress());
byte[] address = me.getAddress();
for (int i = 0; i < address.length; i++) {
System.out.print(address[i] + " ");
}
System.out.println();
} catch (UnknownHostException e) {
System.err.println("Could not determine local address.");
System.err.println("Perhaps the network is down?");
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -