Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区 » 实战错误讨论  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Re:请教高手,为什么编译通不过? [Re:雪中行]
tianyake





发贴: 4
积分: 0
于 2005-03-13 23:21 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
你太不小心了,
import java.net.URL;
import java.net.MalformedURLException;

class getURLinfo
{
public static void main(String args [])
{
URL url=null;
try
{
url=new URL("http://www.edu.cn/20050311/3130828.shtml");
}
catch(MalformedURLException e)
{
System.out.println("MalformedURLException:"+e);
}
System.out.println("Protocol:"+url.getProtocol());
System.out.println("Host:"+url.getHost());
System.out.println("Port:"+url.getPort());
System.out.println("File:"+url.getFile());
System.out.println("Ref:"+url.getRef());
}
}
这样就行了。在jbuilder2005运行正常




话题树型展开
人气 标题 作者 字数 发贴时间
9128 请教高手,为什么编译通不过? 雪中行 648 2005-03-12 16:47
7642 Re:请教高手,为什么编译通不过? kimmy 87 2005-03-12 22:45
7649 Re:请教高手,为什么编译通不过? ma1673 5 2005-03-13 15:28
7545 Re:请教高手,为什么编译通不过? 雪中行 21 2005-03-13 17:48
7594 Re:请教高手,为什么编译通不过? kimmy 12 2005-03-13 23:17
7690 Re:请教高手,为什么编译通不过? tianyake 696 2005-03-13 23:21
7653 Re:请教高手,为什么编译通不过? ma1673 7 2005-03-14 09:54
7674 Re:请教高手,为什么编译通不过? ma1673 141 2005-03-14 09:59
8026 Re:请教高手,为什么编译通不过? lenkeny 10 2005-03-14 23:46

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923