• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to access these data member?  RSS feed

 
vivek nehra
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Tim Moores
Saloon Keeper
Posts: 4036
94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is "these"? What do you expect this code to do, and what does it actually do?
 
vivek nehra
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to access this "jt" from method call to my method run...
 
Tim Moores
Saloon Keeper
Posts: 4036
94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You probably need to make it final.

As an aside, you should just about never extend the Thread. Implementing the Runnable interface accomplishes the same without the drawbacks.
 
Norm Radder
Rancher
Posts: 2240
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also posted (and answered) here: https://www.java-forums.org/new-java/97325-how-access-these-data-member.html
 
Piet Souris
Master Rancher
Posts: 2044
75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can turn some local variables into members, but beware of a NullPointerException when the run-method is executed.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!