Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
om ganesh
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.
 
om ganesh
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok Thanks Paul
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic