-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathURLTEST.java
More file actions
22 lines (18 loc) · 767 Bytes
/
Copy pathURLTEST.java
File metadata and controls
22 lines (18 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package java_base;
import java.net.MalformedURLException;
import java.net.URL;
public class URLTEST {
public static void main(String[] args) throws MalformedURLException {
// TODO Auto-generated method stub
URL aurl = new URL("https://java.sun.com:80/docs/books");
URL tuto = new URL(aurl, "tutorial.into.html#DOWNLOADING");
System.out.println("protocol = " + tuto.getProtocol());
System.out.println("host = " + tuto.getHost());
System.out.println("port = " + tuto.getPort());
System.out.println("ref = " + tuto.getRef());
System.out.println("query = " + tuto.getQuery());
System.out.println("path = " + tuto.getPath());
System.out.println("UserInfo = " + tuto.getUserInfo());
System.out.println("Authority = " + tuto.getAuthority());
}
}