I am trying to create a method to increase the value of various variables, here is an example of the type of logic i'm currently using, however when the method is finished the original variable has not changed. What do I need to add or replace to allow the value to change outside the method?
static int num = 2;
static String text = "3";
public static void up(int i, String s){
//Debug
System.out.println("Before Change");
System.out.println("I: " + i);
System.out.println("S: " + s);
System.out.println("Num: " + num);
System.out.println("Text: " + text);
//Code
i = i + 3;
s = String.valueOf(i);
//Debug
System.out.println("After Change");
System.out.println("I: " + i);
System.out.println("S: " + s);
System.out.println("Num: " + num);
System.out.println("Text: " + text);
}
public static void main(String[] args) {
up(num, text);
//Debug
System.out.println("Out of Scope");
System.out.println("Num: " + num);
System.out.println("Text: " + text);
}