📄 main.java
字号:
import java.net.*;
class Main {
public static void main(String[] args) {
try {
URL url = new URL("http://java.sun.com");
System.out.println(url.getProtocol()); // http
url = new URL("ftp://java.sun.com");
System.out.println(url.getProtocol()); // ftp
// The following causes a MalformedURLException
// since there is no protocol handler for foobar.
url = new URL("foobar://java.sun.com");
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -