Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing method and calling back - Part 2

 
Carie Herrick
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi -

I think I got my code to maybe work, but I'm getting a compiler issue in my getIntFromKeyboard() method. It's not recognizing the numberEntered string value I'm passing to it to parse.

Can someone take a look and tell me what I'm missing?

I'm not good at this coding stuff and am having a hard time putting it all together...

Thanks!

 
Carie Herrick
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NEVER MIND - just got it to work...

Sorry!
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not recognizing the numberEntered string value I'm passing to it to parse.

And there's your problem: Where are you passing it anything? The method has no parameters (a String parameter would work nicely here), and the variable you're trying to get is local to the main method and thus invisible to the method.

My recommendation: Keep the variable local and use a parameter to pass the String to the method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic