Which is thread safe ? (a) Only the variable num (b) Only the HttpServletRequest object req (c) Both the variable num & the HttpServletRequest object req

Showing Answers 1 - 3 of 3 Answers

Rizwan Ahmed

  • Apr 23rd, 2006
 

(b) Only the HttpServletRequest object req
Thread safety of the variable is depend on the scope of the variable.

Local variable-thread safe

instance variable-not thread safe(yes for Single thread model)

class variable-not thread safe

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions