Program : Uniform Resource Locator (URL)
By : Kapil Lohia
import java.net.*;
import java.io.*;
class url
{
public static void main(String args[]) throws Exception
{
URL n1 = new URL("http://java.sun.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());
}
} |
import java.net.*;
import java.io.*;
class url
{
public static void main(String args[]) throws Exception
{
URL n1 = new URL("http://java.sun.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());
}
}
Editorial Team
We are a group of young techies trying to provide the best study material for all Electronic and Computer science students. We are publishing Microcontroller projects, Basic Electronics, Digital Electronics, Computer projects and also c/c++, java programs.