Java program for Uniform Resource Locator (URL)

Java program for Uniform Resource Locator (URL)


[java]

class url
{
public static void main(String args[]) throws Exception

{
URL n1 = new URL("http://shareittips.com:80/docs/index#down");

System.out.println("Protocol:"+n1.getProtocol());

System.out.println("Host :"+n1.getHost());

System.out.println("File Name :"+n1.getFile());

System.out.println("Port :"+n1.getPort());

System.out.println("Reference :"+n1.getRef());
}
}

[/java]

Share

About the Author

Akash Padhiyar

Visit Website

There are no comments yet, add one below.

Leave a Comment

Your email address will not be published. Required fields are marked *

*

Time limit is exhausted. Please reload CAPTCHA.