This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Threas - Object Locks Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Threas - Object Locks Question" Watch "Threas - Object Locks Question" New topic
Author

Threas - Object Locks Question

Vidyavathi saravanan
Ranch Hand

Joined: Sep 24, 2004
Posts: 34
This is one of the questions from K&B.

Assume u have a class that holds two private variables: 'a' and 'b'. Which of the following pairs can prevent concurrent access problems in that class.?



Answers: B and F
My question is why not E ?
Joe Borderi
Ranch Hand

Joined: Oct 23, 2004
Posts: 151
Go ask your compiler.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18509
    
  40

My question is why not E ?


Simply, Choice E is not valid Java syntax.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Threas - Object Locks Question
 
Similar Threads
Doubt in K&B Question on Thread
Why autoboxing doesnt work here???
Threads Questions?
synchronized
Thread question