Original Post
I have read all over that having your variables kept private in a class, and having 1 method for accessing, and 1 method for assigning is the best way. I would like to know why. Ive heard that it prevents errors in assignment, but couldnt you just do the same thing when you call setX(7) when you meant to type 8? The reason I ask is because in my RPG, I have TONS of variables within all the classes, and I was just wondering what is generally thought on this. Thanks