wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Synchronized Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Synchronized" Watch "Synchronized" New topic
Author

Synchronized

Allan Tan
Greenhorn

Joined: Oct 31, 2000
Posts: 7
Which of the following can be synchronized ?
methods?
member variables?
local variables?
code blocks?
static/non-static class?
Paul Caudle
Ranch Hand

Joined: Jun 08, 2000
Posts: 64
Hi Allan,
Methods and code blocks are the only items in your list that may be synchronized.
A method may be synchronized using it in the header as in:

and a block of code may be syncronized like the following:

I hope that helps,
Paul
[This message has been edited by Paul Caudle (edited November 06, 2000).]
[This message has been edited by Paul Caudle (edited November 06, 2000).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Synchronized
 
Similar Threads
synchronized keywords in static methods
Static variable Question?
Interfaces?
DATASETS IN SERVLETS?
Synchronized Class