aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Another One from Threads... 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 "Another One from Threads..." Watch "Another One from Threads..." New topic
Author

Another One from Threads...

Harry Singh
Ranch Hand

Joined: May 02, 2001
Posts: 124

So whats the answer of this one...I thought it to be A and C but as per mocks the only correct answer is A.As per my understanding after starting a new thread, the main thread will stop and as a result, all other threads associated with main thread also stops.. am i right? or is it only the daemon threads that stops when main stops executing.
Andris Spruds
Greenhorn

Joined: Aug 18, 2003
Posts: 3
what happens is that start() asks Virtual Machine to start a new thread and returns *immediately* without waiting for the new thread to be created/started/etc/
That's right - only A is correct.
[ September 22, 2003: Message edited by: Andris Spruds ]
[ September 22, 2003: Message edited by: Andris Spruds ]
Barkat Mardhani
Ranch Hand

Joined: Aug 05, 2002
Posts: 787
is it only the daemon threads that stops when main stops

Yes
Steve Lovelace
Ranch Hand

Joined: Sep 03, 2003
Posts: 125
Harjinder:
Sounds like you've got it, but this wording is worrisome: is it only the daemon threads that stops when main stops.
There's nothing special about the "main" thread. The VM quits when there are no more non-daemon threads alive. Non-daemon threads are called "user" threads. So you could rephrase with something like: it is only user threads that keep the VM running.


The Inner that is named is not the true Inner.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Another One from Threads...
 
Similar Threads
Question related to threads
Threading question from Dan's site
Thread2
one more question from Dan's questions
thread doubt