Edited: I need to change the values of several variables as they run several times thorugh a timer. I need to keep updating the values with every iteration through the timer
what worked for me is just define the variable outside this function of your.
Just before main function declare i.e.
Double price; public static void main(String []args(){ -------- -------- }