I learned static method today, and I am confused about how values change inside the static method. When I write static method like this
public class test{
public static int printInt(int t,int n){
System.out.println(t);
t= t + n;
return n;
}
}
and call it in main
public class Method {
public static int i;
public static int m;
public static void main(String[] args){
i = 5;
m = 6;
test.printInt(i,m);
System.out.println(i);
}
}
the t do not change as I suppose to. If the static method only make change into values that you return?