/*
* Output:
*
*
Protocol: http
Port: -1
Host: www.rntsoft.com
File:
Ext:http://www.rntsoft.com
*/
import java.net.URL;
public class MainClass {
public static void main(String args[]) throws Exception {
URL hp = new URL("http://www.rntsoft.com");
System.out.println("Protocol: " + hp.getProtocol());
System.out.println("Port: " + hp.getPort());
System.out.println("Host: " + hp.getHost());
System.out.println("File: " + hp.getFile());
System.out.println("Ext:" + hp.toExternalForm());
}
}