Re: Book question on threads

From: Tony Morris (dibblego_at_optusnet.com.au)
Date: 06/09/04


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


Relevant Pages

  • Re: Garbage collection
    ... Two reasons I'm sure: ... Sun Certified Programmer for the Java 2 Platform ... Sun Certified Developer for the Java 2 Platform ...
    (comp.lang.java.programmer)
  • Re: 1.2 v 1.4 exam
    ... > Can someone advise me how much more valuable the 1.4 certification is ... I simply purchased the exam voucher, rang Prometric, and went to ... Sun Certified Developer for the Java 2 Platform ...
    (comp.lang.java.programmer)
  • Re: HardBound and SoftBound
    ... and neither C# nor Java come close to C/C++. ... from time to time when changes are required or for speed reasons. ... speeds comparable with the C++ C# compiler from MS. ... In practice RISC wasn't such a big change, ...
    (comp.arch)
  • 23 java certification ebooks for free
    ... - Manning SCWCD Exam Study Kit Second Edition: Java Web Component ... Java - SCJP Certification Package ... 18 - Manning SCWCD Exam Study Kit Java Web Component Developer ...
    (comp.lang.java.programmer)
  • 23 java certification ebooks for free
    ... - Manning SCWCD Exam Study Kit Second Edition: Java Web Component ... Java - SCJP Certification Package ... 18 - Manning SCWCD Exam Study Kit Java Web Component Developer ...
    (de.comp.lang.java)

Loading