File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
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:
Thread-safe Action class ?
Cleared the SCJD - 144/155
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-2013