import java.*;
import java.net.*;

public class parsing_url
{
 public static void main(String arg[]) throws Exception
  {
   URL aurl = new  URL("https://example.com:80/docs/books/tutorial"+"/index.html?name=networking#UPLOADING");
  
   System.out.println("Protocol is : "+aurl.getProtocol());
   System.out.println("Authority is : "+aurl.getAuthority());
   System.out.println("Host is : "+aurl.getHost());
   System.out.println("Port is : "+aurl.getPort());
   System.out.println("Path is : "+aurl.getPath());
   System.out.println("Query is : "+aurl.getQuery());
   System.out.println("File is : "+aurl.getFile());
   System.out.println("Reference is : "+aurl.getRef());
  
   }

}


OUTPUT


Leave a Reply

Subscribe to Posts | Subscribe to Comments

All Notes on BCA

All Notes  on BCA
BCA all subjects notes

Total Pageviews

Translate

Powered by Blogger.

Copyright © All Notes on BCA