Note that in this case the OP is using STATIC on the method, not a
variable as far as I know.

Which simply means that the method my be called without an instance of
the class. Usually used for utility type methods that operate solely
on the passed in parms. Examples: most of the methods in the Math and
also java.util.Random classes.

The thread safety of a method is not affected by the use of STATIC.

HTH,
Charles

On Wed, Mar 31, 2010 at 12:29 PM, Joe Sam Shirah <joe_sam@xxxxxxxxxxxxx> wrote:
   Second, using things when "I'm not really clear on what that means" is
not a good idea.  Static means a class variable; i.e. there is only one for
all instances of the class.  You don't even need to construct an instance to
use it.  Sounds cool, but you've just thrown away any chance of
multi-threading using that variable.  If it's a constant, great (probably,)
but if it's really a variable for an instance, or intended to work as a
local variable, you can run across a class of bugs that is very difficult to
resolve.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.