I have the following instantiated variable
public static int r1 = 10;
I have several of these variables r1
- r4
, I want to write a method that will be able to take the variable r1
as a parameter of the method and increment it.
Pseudo code would look like :
r1 = r1 + 1;
My question is how can I take the variable as a parameter of one method instead of writing 4 different methods to accomplish this?