This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Java in General and the fly likes synchronization query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "synchronization query" Watch "synchronization query" New topic
Author

synchronization query

shital sonavane
Greenhorn

Joined: Jan 28, 2011
Posts: 20

Hi all,
Please clear my query.

suppose i have one class which contain two methods a() and b() from which a() is static synchronized and b() is non static , synchronized.
Now my one thread is trying to access both the methods at same time. how the code will behave???

Thanks in advance.
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3983
    
  18

If you have one thread, it can't access both methods at the same time. Do you mean that one of the two methods is called from the other method?


The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: synchronization query
 
It's not a secret anymore!