G
gk
"...the instance , static variables used in a servlet reference
object are not thread safe..."
why instance variables are not thread safe ?
say i have
class MyServlet extends HttpServlet
{
Sting x;
String y;
//doGet()
//doPost()
}
How , this x,y cant be thraed safe ?
seperate instance will have there own copy and hence they are not
going to be mixed up in multithreading enviornment.
so, these variables are thread safe .
could you please explain ...why that statement is correct ?
object are not thread safe..."
why instance variables are not thread safe ?
say i have
class MyServlet extends HttpServlet
{
Sting x;
String y;
//doGet()
//doPost()
}
How , this x,y cant be thraed safe ?
seperate instance will have there own copy and hence they are not
going to be mixed up in multithreading enviornment.
so, these variables are thread safe .
could you please explain ...why that statement is correct ?