Java解析URL

xiaoxiao2026-08-02  11

import java.net.URL; public class Test ...{     public static void main(String[] args)      throws Exception ...{          URL aURL = new URL("http://www.douban.com/group/echofans");          System.out.println("protocol = " + aURL.getProtocol());          System.out.println("authority = " + aURL.getAuthority());          System.out.println("host = " + aURL.getHost());          System.out.println("port = " + aURL.getPort());          System.out.println("path = " + aURL.getPath());          System.out.println("query = " + aURL.getQuery());          System.out.println("filename = " + aURL.getFile());          System.out.println("ref = " + aURL.getRef());      }

转载请注明原文地址: https://www.6miu.com/read-5050597.html

最新回复(0)