Let say I have a typical java class like
public class Waiter {
private int Id;
private String name;
private int active;
//Including constructor, getter and setter
}
And now I want to make a function that can change the variable in active. I know, in this case, I can simply use the setters, but I want to inside a function that I can call when I need to.
My function currently looks like this
public void login(int a) {
int b = 2;
a = b + a;
}
Now I want to call it with
login(2)
but it won't update my a value in main?