Procedure to make a connection to the URL

Briefly describe the procedure to make a connection to the URL?

E

Expert

Verified

At first, obtain a URL instance and then invoke openConnection on it. The URLConnection is an abstract class that signifies you cannot directly make instances of it by using a constructor. You have to invoke openConnection process on a URL instance, to obtain the right type of connection for your URL. Example: URL url;

URLConnection connection; try{ url = new URL("..."); connection = url.openConnection(); }catch (MalFormedURLException e) { }

   Related Questions in Computer Networking

©TutorsGlobe All rights reserved 2022-2023.