@@ -0,0 +1,958 @@
+package learn_to_code.java_api.net.URL;%0A%0A%0Aimport java.io.IOException;%0Aimport java.net.HttpURLConnection;%0Aimport java.net.URL;%0Aimport java.net.URLConnection;%0A%0Apublic class URLExample %7B%0A    public static void main(String%5B%5D args) throws IOException %7B%0A        URL url = new URL(%22http://google.com%22);%0A        System.out.println(url.getHost());%0A%0A        URLConnection urlConnection = url.openConnection();%0A%0A        System.out.println(%22URL methods:%22);%0A        for (String header : urlConnection.getHeaderFields().keySet()) %7B%0A            System.out.printf(%22header: %2520s = %25s%5Cn%22, header, urlConnection.getHeaderFields().get(header));%0A        %7D%0A%0A        System.out.println(%22HTTP url methods:%22);%0A        HttpURLConnection httpUrlConnection = (HttpURLConnection) url.openConnection();%0A        System.out.println(%22Response code: %22 + httpUrlConnection.getResponseCode());%0A        System.out.println(%22Response message %22 + httpUrlConnection.getResponseMessage());%0A    %7D%0A%7D%0A%0A%0A

Add URL example