"Cyper Hunter" <cy*******@gmail.com> wrote in message
news:5T**********************@news4.srv.hcvlny.cv. net...
Hi:
Do you know how to change the url string of URL object? For example,
I have an URL object declared as:
URL myurl = new URL("http://www.cnn.com");
How to change the url string of myurl to be "http://www.yahoo.com"?
Thanks.
From the docs:
set
protected void set(String protocol,
String host,
int port,
String file,
String ref)
Sets the fields of the URL. This is not a public method so that only
URLStreamHandlers can modify URL fields. URLs are otherwise constant.
In other words, you can't.
In the future, please direct your posts to comp.lang.java.help. This group
is deprecated.