Harikrishna Gorrepati wrote:Hi Stephan, I agree with you on "Static methods should always be called with a class identifier". Could you please advice the possible reason(s) "why static methods should not be called using reference ?"
Stephan van Hulst wrote:Use Thread.sleep(). Static methods should always be called with a class identifier, or rather, they should never be called using an object reference. The latter is confusing.
Because, a static method can hide another static method. Calling it on the object(if it polymorphically referred) can cause problems. So, it's better to avoid it.