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

📄 inetaddressdemo.java

📁 利用Socket编写的一个一对一聊天的程序
💻 JAVA
字号:
/* * InetAddressDemo.java * * Created on 2007年11月13日, 下午11:22 * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */package 一对一聊天;import java.net.*;class InetAddressDemo{    public static void main (String [] args) throws UnknownHostException    {    String host = "localhost";    if (args.length == 1)    host = args [0];    InetAddress ia = InetAddress.getByName ("www.baidu.com");    System.out.println ("Canonical Host Name = " +    ia.getCanonicalHostName ());        System.out.println ("Host Address = " +    ia.getHostAddress ());        System.out.println ("Host Name = " +    ia.getHostName ());        System.out.println ("Is Loopback Address = " +    ia.isLoopbackAddress ());}}

⌨️ 快捷键说明

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