I am trying to use a simple println(...) statement to display the value of a variable from a separate class.
The two separate classes are linked.
AbacusModel class has an array 'peg_array' which stores the number of counters present in each of the elements of the array.
AbacusModel has a variable 'thisPeg' which is used to refer to any of the pegs in the array e.g. peg_array[thisPeg]
In the seperate class (AbacusPanel) i want to call the number of counters present in any particular element that the user clicks in. but it displays "error: cannot find symbol" which is due to it being an instance variable of the AbacusModel class. How can i print this value in the AbacusPanel class???
I am in need of help here as my java knowledge is very limited so any ideas would be a great help. Thanks :)