?? getnetinfo.java
字號(hào):
/** * Title: Java網(wǎng)絡(luò)編程演示 * Description: Java網(wǎng)絡(luò)編程演示,用于北京師范大學(xué)計(jì)算機(jī)系Java課程教學(xué)示范。 * Copyright: Copyright (c) 2001 * Company: 北京師范大學(xué)計(jì)算機(jī)系 * @author 孫一林 * @version 1.0 */import java.net.URL;import java.net.MalformedURLException;public class getnetinfo { public getnetinfo() { } public static void main(String args[]) { URL getnetinfoURL = null; try { getnetinfoURL = new URL("http://www.bnu.edu.cn:8080/index.html"); } catch(MalformedURLException e) { System.out.println("MalformedURLException:"+e); } System.out.println("Protocol: "+getnetinfoURL.getProtocol()); System.out.println("Host Name: "+getnetinfoURL.getHost()); System.out.println("Port Number: "+getnetinfoURL.getPort()); System.out.println("File Name: "+getnetinfoURL.getFile()); System.out.println("Reference: "+getnetinfoURL.getRef()); } }
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -