Java URL getAuthority() 方法

2025年3月24日 | 1 分钟阅读

URL 类的 getAuthority() 方法用于获取给定 URL 的 authority 部分。

语法

返回值

此 URL 的 authority 部分

自从 (Since)

1.3

示例 1

输出

Enter Url 
https://:8080/notic/note.jsp
Authority part of the url  : localhost:8080

示例 2

输出

 Url Authority : www.tpointtech.com
 The mime type is : text/html; charset=iso-8859-1
下一个主题Java URL 类