A
A
adast2016-08-01 18:10:52
Java
adast, 2016-08-01 18:10:52

How to get a variable from another method of the same class?

How to get a variable from another method of the same class?
public class Main {
private void a() {
int number = 5;
}
private void b() {
How to read number variable?
return do not suggest it is already taken and cannot be changed
}
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question