Click to See Complete Forum and Search --> : help please!


May 10th, 2000, 03:45 PM
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

kib63613
May 10th, 2000, 05:33 PM
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