Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

local rariable  RSS feed

 
Timber Lee
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is the local rariable in servlet thread safe? why?
thank you in advance!
 
AJAY RANA
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because every thread gets its own copy of local variable.so ,even if multiple threads are accessing a method each thread would have its own copy of local variable.
Regards,
Ajay Rana
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!