0% found this document useful (0 votes)
2 views2 pages

Import Java

The document contains a Java program that demonstrates the use of the URL class to extract various components of a specified URL (http://www.irctc.co.in). It prints the authority, file, host, path, port, protocol, query, reference, and user info of the URL. The output shows the extracted information, indicating that the URL has no specific file, path, query, reference, or user info associated with it.

Uploaded by

kaustubhfand296
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Import Java

The document contains a Java program that demonstrates the use of the URL class to extract various components of a specified URL (http://www.irctc.co.in). It prints the authority, file, host, path, port, protocol, query, reference, and user info of the URL. The output shows the extracted information, indicating that the URL has no specific file, path, query, reference, or user info associated with it.

Uploaded by

kaustubhfand296
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

import [Link].

*;

import [Link].*;

class URLDemo

public static void main(String ar[]) throws IOException

URL url = new URL("[Link]

[Link]("Authority = " + [Link]());

[Link]("File = " + [Link]());

[Link]("Host = " + [Link]());

[Link]("Path = " + [Link]());

[Link]("Port = " + [Link]());

[Link]("Protocol = " + [Link]());

[Link]("Query = " + [Link]());

[Link]("Ref = " + [Link]());

[Link]("User Info = " + [Link]());

//output:-

C:\Users\map\Desktop\akanksha&[Link]>javac [Link]
C:\Users\map\Desktop\akanksha&[Link]>java URLDemo

Authority = [Link]

File =

Host = [Link]

Path =

Port = -1

Protocol = http

Query = null

Ref = null

User Info = null

You might also like