THE PACKAGE JAVA.LANG
java.lang.Thread
20.20
PrimeRun p = new PrimeRun(143);
new Thread(p).start();
Every thread has a name, which is a
String
, for identification purposes. More
than one thread may have the same name. If a name is not specified when a thread
is created, a new name is generated for it.
Every thread that has not yet been stopped belongs to a thread group ( 20.21).
A thread can always create a new thread in its own thread group. To create a
thread in some other thread group requires the approval of the
checkAccess
method ( 20.21.4) of that thread group, which forwards the decision to the secu
rity manager ( 20.17.11).
20.20.1
public final static int MIN_PRIORITY = 1;
The constant value of this field is
1
, the smallest allowed priority for a thread.
20.20.2
public final static int MAX_PRIORITY = 10;
The constant value of this field is
10
, the largest allowed priority value for a
thread.
20.20.3
public final static int NORM_PRIORITY = 5;
The constant value of this field is
5
, the normal priority for a thread that is not a
daemon.
20.20.4
public Thread()
This constructor initializes a newly created
Thread
object so that it has no sepa
rate run object, has a newly generated name, and belongs to the same thread group
as the thread that is creating the new thread.
This constructor has exactly the same effect as the explicit constructor call
this(null, null, gname)
( 20.20.10), where
gname
is a newly generated
name. Automatically generated names are of the form
"Thread "+n
, where
n
is
an integer.
591
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved