Re: Book question on threads
From: Tony Morris (dibblego_at_optusnet.com.au)
Date: 06/09/04
- Next message: Ryan Stewart: "Re: Book question on threads"
- Previous message: xarax: "Re: Book question on threads"
- In reply to: Ryan Stewart: "Book question on threads"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 9 Jun 2004 10:45:00 +1000
"Ryan Stewart" <zzanNOtozz@gSPAMo.com> wrote in message
news:PYmdnbLNs_OwyFvdRVn-sQ@texas.net...
> Reading a Java certification book, I came across this question:
> "Which of these are plausible reasons why a thread might be alive, but
still
> not be running?
> Select all valid answers.
> a) The thread is waiting for some condition as a result of a call to
wait().
> b) The thread is waiting on a monitor for an object so that it may access
a
> certain member variable of that object.
> c) The thread is not the highest priority thread and is currently not
> granted CPU time.
> d) The thread is sleeping as a result of a call to the sleep() method."
>
> I said a, b, and d. The book says:
> "a, b, c, and d
> Note that only methods and code blocks can be specified as synchronized.
> Variables cannot be declared as synchronized.Code blocks can be
synchronized
> on any object."
>
> Their given reason seems to support my answer more than theirs. I'm
thinking
> typo. What do you think? What would your answer be?
I agree with the book, and I don't understand your reasoning, so I can't
elaborate on why I think you are wrong - only that you are.
-- Tony Morris (BInfTech, Cert 3 I.T.) Software Engineer (2003 VTR1000F) Sun Certified Programmer for the Java 2 Platform (1.4) Sun Certified Developer for the Java 2 Platform
- Next message: Ryan Stewart: "Re: Book question on threads"
- Previous message: xarax: "Re: Book question on threads"
- In reply to: Ryan Stewart: "Book question on threads"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|