⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.java

📁 java的经典例子
💻 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 + -