📄 urldemo.java
字号:
/**
*A simple URL program
*2004.12.1. xhcprince
*/
import java.net.*;
import java.io.*;
public class URLDemo
{
public static void main(String args[]) throws IOException
{
URL u = new URL("http://java.sun.com:80/docs/index/#down");
System.out.println("Protocol: " + u.getProtocol());
System.out.println("Host: " + u.getHost());
System.out.println("File name: " + u.getFile());
System.out.println("Port: " + u.getPort());
System.out.println("Reference: " + u.getRef());
}
}
/*-------------------------------------------------------------------------
*The output are:
*Protocol: http
*Host: java.sun.com
*File name: /doc/index/
*Port: 80
*Reference: down
-------------------------------------------------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -