Javatpoint Logo
Javatpoint Logo

Java URL getAuthority() method

The getAuthority() method of the URL class is used to get the authority part of given URL.

Syntax

Returns

The authority part of this URL

Since

1.3

Example 1

Output:

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

Example 2

Test it Now

Output:

 Url Authority : www.javatpoint.com
 The mime type is : text/html; charset=iso-8859-1
Next TopicJava URL Class





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA