I have a static method I'm using as a utility in a Servrlet class. Since the servlet class will be threaded I'm worried about data integrity. The question is really simple. If I declare an array within a static method like this:
someObject [] arrayOfSomeOjbect = method ();
If method () returns an array of someObject am I actually allocating memory for a new array each time or do I risk the threat of the threads overwriting the variable?
I understand with new instances of objects I risk no threat but wasn't sure if this was the same case.
someObject [] arrayOfSomeOjbect = method ();
If method () returns an array of someObject am I actually allocating memory for a new array each time or do I risk the threat of the threads overwriting the variable?
I understand with new instances of objects I risk no threat but wasn't sure if this was the same case.