File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Death of a thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Death of a thread " Watch "Death of a thread " New topic

Death of a thread

Deepali Pate
Ranch Hand

Joined: Mar 20, 2002
Posts: 114
Death of a thread can occur
When exception is thrown
System.exit(0) is called
and run() ends
are all these satements true.
Threads have parent-child relationship is this true or false
Amir Ghahrai
Ranch Hand

Joined: Jun 19, 2002
Posts: 110
They are all true,
since once you call System.exit(0), it terminates the execution of the main thread from which your child threads have been spawned, therefore they die too.
all threads that have been spawned from the main thread, they inherit the main thread priority, therefore there is a relation between parent and child thread.

Deepali Pate
Ranch Hand

Joined: Mar 20, 2002
Posts: 114
This ? at this link.
Q10. State which of the following statements are True.
(1) Concurrent Java programs can exhibit deterministic behavior, by providing mechanisms for synchronizing.
(2) Threads have parent-child relationships.
(3) When the thread is created, it is not yet active
1 and 3
All 3
1 and 2
gives answer is is 1 and 3 when i think all 3 are true.
I agree. Here's the link:
subject: Death of a thread
jQuery in Action, 3rd edition