A scope too wide?
Consider the following text:
Q. "Make the scope of your variables always as narrow as possible,
otherwise conflicts exist in threads; all methods have access to the attribute of the class."
What is the problem with this? What's wrong with having an attribute whose scope is too wide?
Can someone please give me a concrete example in which this problem is explained?
You may wish to show the fruits of your effort in this and your other questions first and for several reasons: it shows us what you do and don't understand, and we'll also know that these questions are not simply homework or interview dumps.
I'm not a native English speaker. What do you mean by 'show the fruits of your effort'?
What are your thoughts about the original question. (hint: what if a member variable is static instead of an instance variable?)
Originally Posted by JUser