Given this code:
public class Test {
public void add(int x){
x++;
}
public static void main(String args[]){
Test t = new Test();
int a = 1;
t.add(a);
System.out.println(a);
}
}
I just want to print out 2 instead of 1. I think I am calling this method wrong. Could you help me understand why?