Featured Post

Step Wise Project Planning

Planning is the most difficult process in project management. The framework described is called the Stepwise method to help to distinguis...

  1. Home

Write a program for displaying information about various parts of the URL

Write a program for displaying information  about various parts of the URL

import java.net.*;
class example
{
public static void main(String agrs[]) throws MalformedURLException
{
URL obj = new URL("http://www.yahoo.com:80/index.html");
System.out.println(" the protocol in the url is :"+ obj.getProtocol());
System.out.println("the port in the url is :"+ obj.getPort());
System.out.println("the host in the url is :"+ obj.getHost());
System.out.println("the file in the url is :"+ obj.getFile());
}

}
Previous
Next Post »