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