Javatpoint Logo
Javatpoint Logo

Java URL getProtocol() Method

The getProtocol() Method of URL class returns the protocol name of this URL.

Syntax

Returns

The protocol of this URL.

Example 1

Test it Now

Output:

Url: https://www.javatpoint.com/URL-class
Protocol used in given url is : https

Example 2

Output:

Given URL is : http://127.0.0.1:8080/apex/wwv_flow_help.show_get_started
Protocal : http
File name : /apex/wwv_flow_help.show_get_started
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