当前位置: 技术问答>java相关
请朋友们帮我看看这个程序的问题在那里??谢谢
来源: 互联网 发布时间:2015-10-27
本文导语: /*java网络编程 *类InetAddress的用法 *文件名ko26-1.java */ import java.net.*; class ko26-1 { public static void main(String args[])throws UnknownHostException { InetAddress addr1,addr2; addr1=InetAddress.getLocalHost...
/*java网络编程
*类InetAddress的用法
*文件名ko26-1.java
*/
import java.net.*;
class ko26-1
{
public static void main(String args[])throws UnknownHostException
{
InetAddress addr1,addr2;
addr1=InetAddress.getLocalHost();
addr2=InetAddress.getByName("www.xjtu.edu.cn");
System.out.println(addr1);
System.out.println(addr2);
InetAddress addr3[]=InetAddress.GetAllByname("www.sohu.com");
for(int n=0;n
*类InetAddress的用法
*文件名ko26-1.java
*/
import java.net.*;
class ko26-1
{
public static void main(String args[])throws UnknownHostException
{
InetAddress addr1,addr2;
addr1=InetAddress.getLocalHost();
addr2=InetAddress.getByName("www.xjtu.edu.cn");
System.out.println(addr1);
System.out.println(addr2);
InetAddress addr3[]=InetAddress.GetAllByname("www.sohu.com");
for(int n=0;n