A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Arduino in Action
this week in the
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
Java in General
regarding static method
Joined: Jan 31, 2006
Apr 10, 2006 01:31:00
If Static method is synchronized which object is considered for lock?
nothing is impossible in the world even the word impossible sounds as I'M'Possible.
Joined: Oct 30, 2001
Apr 10, 2006 02:20:00
The instance of
associated with the class in which the method resides.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.<br /> <br />#:^P
Joined: Jan 09, 2006
Apr 10, 2006 02:52:00
just want add something to what Peter Chase said...
For every class loaded, the JVM has a corresponding
instance. So when a static method is synchronized, it's the lock of
instance which is used.
for instance methods there will be one lock per instance and for static methods one lock per class
"Work for a cause and not applause. Live to express and not to impress"
I agree. Here's the link:
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: regarding static method
Float wrapper takes double primitive implicitly.
can a static method be override.
tere is a ques abt static method.
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013