@xmruibi
2015-03-26T22:03:48.000000Z
字数 558
阅读 640
Java_Foundation
Access Level
Make each class or member as inaccessiable as possible!
Implements Serializable may leak this class in API.
Instance field and static field must not be public!
Lost the control of this field and not thread safety but may be okay for immutable final instance field.
The only two ways to return above field is by establish a immutable list or create a public method returning clone object!
Don't expose the internal data field:
public class should not expose any mutable field;
