Justice Smith wrote:Here I am again. Trying to create this first class (Bank Account), then use it in class (Tester). It tells me it can't recognize variable "balance" when I try to compile class Tester.
I don't know what I'm doing wrong, but it says it can't recognize the variable "balance" in the second set of code.
Hi use myAccount.balance instead of balance inside system.out.println
however its not the way to access variables.... read about getters and setters...so whenever outside the class you are trying to access or chnage the value of any variable
you should access it through getters and chnage it by using setters
google it you can find so many tutorials on it...
and you are getting that error because you are trying to access non static variable inside static method(here main())