Hi,
I'm currently working on a helper function to do some of the back-end
processing for my servlets. I would like to make the methods in the helper
function static, so that I don't have to worry about instantiating the
object. However, I'm wondering about the local variables in the static
method. Is there only one copy of the local variables in the static
methods, or does each thread executing the method get its own copy of the
variables.
Here is an example of what I'm talking about:
In the servlet, I have this method call:
....
int key = myUtils.getKey(id)
....
In the myUtils class, I have this method:
public static int getKey(String id)
{
.....
int counter = 0;
.....
}
Does each thread that executes this method get its own copy of the counter?
Thanks,
Craig Sullivan
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html