Threads in Java

Threads

Multithreading refers to two or more tasks executing concurrently within a single program. A thread is an independent path of execution within a program. Many threads can run concurrently within a program. Every thread in Java is created and controlled by the java.lang.Thread class. A Java program can have many threads, and these threads can run concurrently, either asynchronously or synchronously.


Thread Constructor Summary
Thread()
Allocates a new Thread object. Thread(Runnable target)
Allocates a new Thread object. Thread(Runnable target, String name)
Allocates a new Thread object.
Thread(String name)
Allocates a new Thread object. Thread(ThreadGroup group, Runnable target)
Allocates a new Thread object. Thread(ThreadGroup group, Runnable target, String name)
Allocates a new Thread object so that it has target as its run object, has the specified name as its name, and belongs to the thread group referred to by group. Thread(ThreadGroup group, Runnable target, String name, long stackSize)
Allocates a new Thread object so that it has target as its run object, has the specified name as its name, belongs to the thread group referred to by group, and has the specified stack size.
Thread(ThreadGroup group, String name)
Allocates a new Thread object.

People who read this post also read :



1 comments:

Thanks! What I think that multithread concept is one of difficult topic to understand in Java. I still remain confused in it. Can you please provide some more explanation regarding it?

Post a Comment

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More