Showing posts with label thread class. Show all posts
Showing posts with label thread class. Show all posts

Friday, 24 January 2014

THE MAIN THREAD

Java Exception in thread main Understanding with Examples

The 'main()' method in Java is referred to the thread that is running, whenever a Java program runs. It calls the main thread because it is the first thread that starts running when a program begins. Other threads can be spawned from this main thread. The main thread must be the last thread in the program to end. When the main thread stops, the program stops running.Main thread is created automatically, but it can be controlled by the program by using a Thread object. The Thread object will hold the reference of the main thread with the help of currentThread() method of the Thread class.

Multi Threaded Programming in java

how to use multithreaded :runnable interface:...

Multithreaded Programming:


Unlike many other computer languages, Java provides built-in support formultithreaded programming. A multithreaded program contains two or more parts that can run concurrently.There are two distinct types of multitasking:process based and thred based.A process.in essence,a program that is executing.