Posts

THREADS in Java

All you need to know about Threads in Java PREREQUISITES The reader should have minimum knowledge of ·          Basic concepts of Object Oriented programming ·          What is exception handling and its importance Points to remember Creating, Instantiating, and Starting New Threads ·          Java is fundamentally multi-threaded. ·          Threads can be created by extending Thread and overriding the public void run() method. ·          Thread objects can also be created by calling the Thread constructor that takes a Runnable argument. The Runnable object is said to be the target of the thread. ·          You can call start() on a Thread object only once. If start() is called more than once on a Thread object, it will throw a RuntimeException. ·          It is legal to create many Thread objects using the same Runnable object as the target. ·          When a Thread object is created, it does not become a thread of execution until its start() metho