Logo F2FInterview

Networking Interview Questions

Q   |   QA

You obtain a URL instance and then invoke openConnection on it. URLConnection is an abstract class, which means you can’t directly create instances of it using a constructor. We have to invoke openConnection method on a URL instance, to get the right kind of connection for your URL.

Eg.

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

In order to link this F2FInterview's page as Reference on your website or Blog, click on below text area and pres (CTRL-C) to copy the code in clipboard or right click then copy the following lines after that paste into your website or Blog.

Get Reference Link To This Page: (copy below code by (CTRL-C) and paste into your website or Blog)
HTML Rendering of above code: