2009-04-22, 02:42 AM
Static methods are also useful when the operation is always the same, and you can't be bothered to create a new object all the time.
For example, Java.lang.Math.random() (or wherever the Math class is; I always have to look it up) is a static method. You wouldn't want to have to create a "Math" class every time you use it... Which would have fairly useless properties anyway.
For example, Java.lang.Math.random() (or wherever the Math class is; I always have to look it up) is a static method. You wouldn't want to have to create a "Math" class every time you use it... Which would have fairly useless properties anyway.

