Using URLConnection in Java

URLConnections are closely related to URLs. Indeed, you get a reference to a URLConnection by using the openConnection() method of an URL object. In many ways, the URL class is only a wrapper around the URLConnection class. URLConnections provide more control over the communication between the client and the server. In particular, URLConnections provide not just input streams by which the client can read data from the server, but also output streams to send data from the client to the server. Continue reading Using URLConnection in Java

  • Share/Bookmark

Using URL in Java

Here I am going to show example which works with URL.
Each URL(Uniform Resource Locator) unambiguously identifies the location of a resource on the Internet.
Example shows how to connect to an URL, download its data and show it in console via System.out

import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;

/**
* This class shows how to work properly with URL
* . . . → Read More: Using URL in Java

  • Share/Bookmark