What causes "Can't find Symbol" and how to fix it?

Read the error message, love the error message.

It takes some practice, but after awhile it's easy to see it more clearly: just read across the bold text below as a sentence :)

error: cannot find symbol [...]

symbol: variable password

location: [in] class Password2.EnterButtonHandler

There is nothing named password in that scope/context (EnterButtonHandler).

Happy coding.


Hint: there is a local variable with the same name in a different scope/context... perhaps it shouldn't be a local variable? See The Java Tutorial: Variables for more :)