try { URL u1 = new URL("http://metalab.unc.edu/index.html"); URL u2 = new URL(u1, îbooks.html"); } catch (MalformedURLException e) {}