This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Threads" Watch "Threads" New topic


Tony reedy

Joined: Jan 11, 2002
Posts: 21
Hi all,
This is discussed previously,but I am confused with the choice c.
what's answer for the following question?
ThreadGroup class instances:
a) Allow threads to be manipulated as a group
b) Provide support for ThreadDeath listeners
c) May contain other ThreadGroups
d) Must contain threads of the same type

the explanations says
c) May contain other ThreadGroups

Thread group is the highest level of aggregation of individual threads. Java doesn't support ( as far as I know ) groups of groups.
But I extracted from de API documentation:
A thread group represents a set of threads. In addition, a thread group can also include other thread groups.

I feel both statements are contradicting.
Is the answer yes or no
Rajinder Yadav
Ranch Hand

Joined: Jan 18, 2002
Posts: 178
Sure you can have a ThreadGroup contain another ThreadGroup, it makes perfect sense to control a 'smaller' group from a larger one
The JDK explanation is correct.
[ March 06, 2002: Message edited by: Rajinder Yadav ]

<a href="" target="_blank" rel="nofollow">Rajinder Yadav</a><p>Each problem that I solved became a rule which served afterwards to solve other problems. --Rene Descartes
It is sorta covered in the JavaRanch Style Guide.
subject: Threads
It's not a secret anymore!