The way I understand your question is, although we declare variables as private, as those variables can be accessed using getters and setters, they are not private. Therefore, what is the meaning of doing that?
Well, when using getters and setters, you can restrict access to the private variables.
I.e.,
private int x;
public int getInt(String password){
if(password.equals("RealPassword")){
return x;
}
}
And the same for the setters.