?? myurl.java
字號:
// ==================== Program Discription ==========================
// 程序名稱:示例12-3: Myurl.java
// 程序目的:熟悉URL對象的創(chuàng)建、使用。
// ==============================================================
import java.net. *;
import java.io.*;
class Myurl
{
public static void main(String args[])
{
try {
URL url=new URL("http://www.tsinghua.edu.cn/chn/index.htm");
System.out.println("the Protocol: "+url.getProtocol());
System.out.println("the hostname: " +url.getHost());
System.out.println("the port: "+url.getPort());
System.out.println("the file:"+url.getFile());
System.out.println(url.toString());
}
catch(MalformedURLException e) {
System.out.println(e);
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -