Re: Thread question
From: David Zimmerman (dzimm_at_hiddenmind.com)
Date: 11/13/03
- Next message: Tim Slattery: "Re: Struts help"
- Previous message: John C. Bollinger: "Re: Thread question"
- In reply to: Kaspar Minosiants: "Re: Thread question"
- Next in thread: John C. Bollinger: "Re: Thread question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 13 Nov 2003 17:36:16 GMT
The main thread is just the thread that enters the main(String[])
method. Any threads that are started by the main thread can start child
threads of their own. There is no parent-child relationship between the
threads, anyway.
Kaspar Minosiants wrote:
> Thanks a lot for answer !
> I've quoted the all question !
> There wasen't any aditional inf .
>
> "xarax" <xarax@email.com> сообщил/сообщила в новостях следующее:
> news:9%Lsb.11387$6c3.5601@newsread1.news.pas.earthlink.net...
>
>>"Kaspar Minosiants" <k-mailnews@yandex.ru> wrote in message
>>news:bp01lp$1i2g3p$1@ID-173791.news.uni-berlin.de...
>>
>>>Hi !
>>>
>>>i've been perplexed about a thread life cycle
>>>
>>>there is question from preparation to SCJP 1.4
>>>
>>>------------------------------------------------------
>>>
>>>which of the following is true regarding main Thread
>>>
>>>1. It's the thread from which other child threads wil be spawned
>>>2. It must be the last thread to finish execution. When the main thread
>>>stops , the program terminates.
>>>3. It has highest priority
>>>4. main is not a thread .
>>>
>>>-------------------------------------------------------
>>>
>>>correct answers are 1 & 2
>>>i'm curious about the second answer [ When the main thread stops , the
>>>program terminates. ]
>>>is it realy true ?
>>>
>>>Thanks a lot !
>>
>>#2 is incorrect. The main thread can finish before
>>other non-daemon threads and the application will
>>continue to execute.
>>
>>However, IF #2 was phrased within the context of
>>the main(String[]) method calling System.exit(0),
>>then it would be correct.
>>
>>
>
>
>
- Next message: Tim Slattery: "Re: Struts help"
- Previous message: John C. Bollinger: "Re: Thread question"
- In reply to: Kaspar Minosiants: "Re: Thread question"
- Next in thread: John C. Bollinger: "Re: Thread question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|