What's the advantage of POJO?
问题 In my project I have a small data structure Key . public class Key implements Serializable { private static final long serialVersionUID = 1L; public String db; public String ref; public Object id; protected Key() { } public Key(String db, String ref, Object id) { this.db = db; this.ref = ref; this.id = id; } } Yes this class is simple and every field is publicly accessible. But someone has suggested I use POJO style classes instead but when I asked why they were unable to tell me. In my