Online Java Compiler By
JavaTpoint.com
import java.net.*; class URLgetUserInfoExample2 { public static void main(String args[]) { try { //creating url class object URL url1 = new URL("https://www.javatpoint.com/java-threadpoolexecutor"); // Fetching userinformation from given url System.out.println("The given url is : "+url1); System.out.println("User information of given url is : "+url1.getUserInfo()); } catch (MalformedURLException e) { e.printStackTrace(); } } }
Output