This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.
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 ]
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.