Java tutorial
//package com.java2s; import java.net.MalformedURLException; import java.net.URL; public class Main { /** * Returns new URL object from the given string URL. */ private static URL createUrl(String stringUrl) { URL url = null; try { url = new URL(stringUrl); } catch (MalformedURLException e) { //handle exception } return url; } }