+ 4
What do these errors mean?
I was making a program in Java and encountered some errors. Here is a link to a screenshot since I doubt it is possible to insert images into these: https://imgur.com/a/xqx9r The code in question: https://code.sololearn.com/c8MLCwQkr72O/?ref=app
3 Answers
+ 13
The scope of the variable commands is only visible within the main method itself and you have 2 ways to solve it:-
â
Move the definition of commands outside of the method as a class variable so every method in the class can access to it.
â
Pass it into the checkValid method as parameter
Hopefully it helps! đ
+ 3
Hi Mia, you can make your code public and then post a link to the code. That way people can run the code, see the error and hopefully help you debug it.
I cannot view your link to see the screenshot as I'm at work and it gets blocked.
+ 3
Okay.