The fourth constructor creates URLs relative to a given URL. For example,
try {
URL u1 = new URL("http://metalab.unc.edu/index.html");
URL u2 = new URL(u1, "books.html");
}
catch (MalformedURLException e) {}
This is particularly useful when parsing HTML.