how to use a variable of one method in another method
Hello! I'm an engineering student, still beggining my JAVA studies...
i've got the flollowing doubt:
when i want to use a method (met2) inside another method (met1), i must use class.met2(variable), right?
what happens is:
in the method met2, i've got a loop (recursion), in which the value of the variable "a" varies in each recursive cycle.
i wanna use the current value of "a" in the method met1....
so I tried to put:
int u= a.met2
and i doesn't work..
if i just use "a" in the method met1, the compiler - eclipse - claims, naturally: "a cannot be solved"...
will anyone gimme some help?
thanks a lot!