This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

<variable> cannot be resolved to a Variable ( Java Programming Eclipse )

 
Johhn Davis
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Added code tags - see UseCodeTags for details]


Eclipse underlines msg in red and says "msg can not be resolved to a variable" inside method start() and graph(). There should be slightest error which i am unable to figure out. Need Help
 
Matthew Brown
Bartender
Posts: 4568
9
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

msg is declared in the init() method. That means its scope is limited to the init() method, and you can't refer to it anywhere else. If you want to be able to refer to it in the other methods you need to declare it at the class level.

By the way, remember Java is case-sensitive and you need to be careful about case. Your Start() method won't work because it's supposed to be start().
 
Johhn Davis
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works ..... Thanks Mr. Brown
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic