标签:style blog http color io os ar java sp
直接上例子:
public class URIMain { public static final String DEFAULT_BROKER_BIND_URL = "tcp://localhost:61616"; public static final String DEFAULT_BROKER_URL = "failover://"+DEFAULT_BROKER_BIND_URL; /** * @param args */ public static void main(String[] args) throws Exception{ String url="http://www.baidu.com?a=b&b=c"; String url1="http://127.0.0.1"; URI uri=new URI(url); System.out.println(uri.getScheme()); System.out.println(aauri.getHost()); System.out.println(uri.getPath()); System.out.println(uri.getQuery()); System.out.println(uri.getPort()); } }
打印结果:
www.baidu.com
a=b&b=c
-1
标签:style blog http color io os ar java sp
原文地址:http://www.cnblogs.com/smallyanxi/p/4042099.html