Difference in using runnable and extends in Thread.

Explain the difference in using runnable and extends in Thread.

We can use Extend Thread class only when the class is not extending another class as Java doesn’t support multiple inheritances. In that case, we can use Runnable interface to create Thread.

When we extend a thread, each thread has a unique object associated with it, whereas with Runnable, many threads share the same object instance.
JAVA Thread safety - Explain the term thread safety and synchronization.
JAVA Thread safety - The term Thread safety means each method in a multithreaded environment...
Difference between a URL instance and a URL connection instance
URL instance and a URL connection instance - URL instance represents the location of a resource, and a URLConnection instance represents a link for accessing or communicating with the resource at the location...
Explain how to make a connection to a URL
How to make a connection to a URL - Connection to the remote object represented by the URL is only initiated when the connect() method of the URLConnection is called...
Post your comment