A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
EJB 3 in Action
this week in the
EJB and other Java EE Technologies
Programmer Certification (SCJP/OCPJP)
Joined: Oct 29, 2002
Feb 23, 2000 08:43:00
can i use synchronized keyword with ordinary methods
that do not involve threads.If so i want a small example
Joined: Jan 30, 2000
Feb 23, 2000 10:56:00
Yes you can. And synchronized methods can be used in a NON-threaded environment. It would be a waste but still...
An example? Put the word "synchronized" in front of any method.
Senior Java Web Application Developer, SCPJ2, SCWCD
I agree. Here's the link:
Cleared the SCJD - 144/155
Thread-safe Action class ?
K&B scjp5 Exercise 9.2 - Synchronizing a block of Code (Chapter 9: Thread)
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014