This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need Answer

 
Shrinivas Mujumdar
Ranch Hand
Posts: 328
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Ranchers,
I need a answer for this question, I am not very sure whether this is a correct forum to ask the same.

Identify which attribute scopes are thread-safe:
Local variables
Instance variables
Class variables
Request attributes
Session attributes
Context attributes
Shriniwas
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like an assignment. I'd read this. Then perhaps you should post what you think the answers might be, and people may help you where you have gone wrong.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Advanced"?

I'm moving this to "Java in General (Beginner)".
 
Shrinivas Mujumdar
Ranch Hand
Posts: 328
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think apart from Instance variables all other variables are threadsafe.

I would be more than happy to know if somebody has different answer than this with logic behind it.

Shriniwas
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll give you a hint: the question doesn't make any sense. Thread safety is not a property of an "attribute scope" (a nonsense term in itself.) Thread safety is a property of a class or of a pattern of data access.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic