Ask coding questions

← Back to all posts
Scoreboard Issues
epiclink29 (1)

Hello, I have been doing java for about a month and wanted to make Rock Paper Scissors. I need help with the scoreboard though. I want it to update everytime the player gets the answer right. I am having issues with referencing the int from an inner class. How do I make a scoreboard for the game if I cant reference the int from an inner class?

Comments
hotnewtop
RYANTADIPARTHI (6001)

You can make a variable equal to 0, and if they get something right, do a plus sign += or + to increase it.

epiclink29 (1)

@RYANTADIPARTHI No you cant, I get an error from it. I need to modify it under another method.

RYANTADIPARTHI (6001)

@epiclink29 you have to make a global var, and increment it each time someone gets something right.