URL u; URLConnection uc; try { u = new URL("http://www.ora.com/"); try { uc = u.openConnection(); System.out.println(uc.getURL()); } catch (IOException e) { System.err.println(e); } } catch (MalformedURLException e) { System.err.println(e); }