URL instance vs. URLConnection instance

Explain the difference between a URL instance and a URLConnection instance.

URLConnection is a class under java.net package. The abstract class URLConnection is the superclass of all classes that represent a communications link between the application and a URL. Instances of this class can be used both to read from and to write to the resource referenced by the URL.

URL instance represents the location of the resources. URLConnection instance is used both to read from and to write to the resource referenced by the URL.
How do I read a line of input at a time in Java?
The standard input stream is represented by the InputStream object System.in. For reading a whole line at a time BufferedReader is chained to an InputStreamReader...
Importance of Thread synchronization for multithreaded programs
Threads share the same memory space, i.e., they can share resources. However, there are critical situations where it is desirable that only one thread...
How to create a thread and start it running.
A thread in Java is represented by an object of the Thread class. Implementing threads is achieved in one of two ways:...
Post your comment