import java.net.*;
class Gotest
{
public static void main(String agrs[]) throws MalformedURLException
{
URL hp = new URL("http://www.javapgms.blogspot.com/Array.html");
System.out.println("Protocol : " +hp.getProtocol());
System.out.println("Port : " +hp.getHost());
System.out.println("Host : " + hp.getHost());
System.out.println("File : " +hp.getFile());
}
}
/*
getProtocol() : Returns the protocal identifier of the given URL object.
getPort() : Returns the integer value of the port number of the URL Object. If the port is not set the it returns -1.
getHost() : Returns The Host Name.
getFile() : Returns The file Name.
getRef() : Returns The reference component
Labels: Advanced Java, Networking
Subscribe to:
Post Comments (Atom)
Okies.