⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gethostname.java

📁 JSON(javascript) object creator and examples
💻 JAVA
字号:
import java.net.*;class getHostName {  public static void main (String args[]) {    try {		byte [] ip = { 208-256, 201-256, 239-256, 36 };		InetAddress address = InetAddress.getByAddress(ip);		System.out.println(address);		address = InetAddress.getByName("100.0.2.52");		System.out.println(address.getHostName());		System.out.println(address.getHostAddress() );		address = InetAddress.getByName("208.201.239.36");		System.out.println(address.getHostName());		System.out.println(address.getHostAddress() );	}    catch (UnknownHostException e) {      System.out.println("Could not find host");    }    catch (java.io.IOException e) {      System.out.println("Could not reach host");    }  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -