string to url in java code example Example: url string from url java URL url = new URL("www.google.com"); string urlString = url.getPath();