java.net.URL各get方法的定义是什么?
呵呵,隐士研究java.net.URL中,源码注释如下:
* @author James Gosling
* @version 1.130, 08/25/04
* @since JDK1.0
哈哈,白胡老头写的,好些个get方法,含义不是很直白,隐士写个小程序把各种值dump出来瞧瞧。输入结果如下:
getAuthority()=so.mdbchina.com
getClass()=classjava.net.URL
getContent()=sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@61de33
getDefaultPort()=80
getFile()=/video/%E7%BE%8E%E5%A5%B3
getHost()=so.mdbchina.com
getPath()=/video/%E7%BE%8E%E5%A5%B3
getPort()=-1
getProtocol()=http
getQuery()=null
getRef()=null
getUserInfo()=null
getClass()=classjava.net.URL
getContent()=sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@61de33
getDefaultPort()=80
getFile()=/video/%E7%BE%8E%E5%A5%B3
getHost()=so.mdbchina.com
getPath()=/video/%E7%BE%8E%E5%A5%B3
getPort()=-1
getProtocol()=http
getQuery()=null
getRef()=null
getUserInfo()=null
本文地址:http://www.45fan.com/dnjc/68205.html