How and where should we use a Static modifier for:
1. Field and
2. Method?
For example in java.lang.Math
class, the fields
Usually when the method only depends on the function parameters and not on the internal state of the object it's a static method (with singletone being the only exception). I can't imagine where static fields are really used (they're the same as global variables which should be avoided).
Like in your example the math functions only depend on the parameters.