URLs
The easiest way to create a URL in Java is to start with a String:
try{
URL myURL = new URL (“http://www.cc.gatech.edu”);
}
catch (MalformedURLException e){
System.err.println (“This method: “ + e.toString());
}
URLs can also be created relative to an existing URL:
try{
URL firstURL = new URL(“http://www.foo.com/top_level”);
URL secondURL =
new URL (firstURL, “lower_level”);
}
catch (Exception e){;}