This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes Does declaring a class's member private have affect the way Thread behaves with it Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Does declaring a class Watch "Does declaring a class New topic
Author

Does declaring a class's member private have affect the way Thread behaves with it

om ganesh
Greenhorn

Joined: Dec 06, 2006
Posts: 18
Hi all,

A doubt occurred to me w.r.t Threads, am playing around with thread

Does declaring a member variable as private affect the way a thread behaves with that variable.

Scenario 1


Scenario 2



This might not worth be a question to ask for, but i am bit new to threading & java - am trying most of the things out on my own so want to clear few concepts.

Also it would be great if some info is given on how a thread's stack might appear- like what all variables will each thread instance have to share or will have an instance of its own.

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18708
    
    8

No.
om ganesh
Greenhorn

Joined: Dec 06, 2006
Posts: 18
ok Thanks Paul
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Does declaring a class's member private have affect the way Thread behaves with it