Possible Duplicates:
Public Data members vs Getters, Setters
Purpose of private members in a class
What is the use of getters and setters when you can just make your variables public and avoid the hassle of such lines as A.setVariableX(A.getVariableY())
?