Online Java Compiler By
JavaTpoint.com
import java.net.URL; import java.util.Scanner; public class UrlGetContentExample1{ public static void main(String args[])throws Exception { //Creating url object URL url1=new URL("https://www.javatpoint.com/"); System.out.println(" Given Url is : "+url1); System.out.println(" The content of given url is: "+url1.getContent()); } }
Output