-
help please!
import java.net.*;
import java.io.*;
class Hyperlink {
public static void main(String[] args) throws Exception {
1. AND HERE I HAVE TO CREATE A URL OBJECT WITH THE FOLLOWING URL
HTTP://WW.MSN.COM
2. ALSO I HAVE TO USE THE getPRotocil, getHost, getRef, getPort and getFile method to this URL
CAN ANYONE HELP PLEASE??
THANKS
-
Re: help please!
You may consider the following code snippet :
URL url = new URL(http://www.msn.com);
String protocol = url.getProtocol();
String host = url.getHost();
String ref = url.getRef();
int port = url.getPort();
String file = url.getFile();
good luck,
Alfred Wu