Should all the setter methods in the JavaBeans remain non-public?
A public setter method in a public class is equivalent to a public member variable in a public class. For example,
public class MyBean
{
private int myInt;
MyBean() {}
public int getMyInt() {
return myInt;
}
public void setMyInt(int aint) {
myInt = aint;
}
}
With the above implementation, a private member variable (myInt) can be reset to be any value since we have a public method in a public class. Should we restrict all the setter methods to be non-public?

