title: Why is it not good to write to static field from instance method in Java?
body: <p>I have found a post here in <a href="https://stackoverflow.com/questions/3630485/whats-the-best-way-to-fix-this-write-to-static-field-from-instance-method-fin">SO</a> discussing the code change required to prevent writing to a static field from an instance method but why is not a good practice to do so ? Why did Java designers allow this then ?In other words why does the compiler not throw an error when some one attempts to do this ?</p>