JaveBean命名规则:
1 ,类名要首字母大写,后面的单词首字母大写
2 ,方法名的第一个单词小写,后面的单词首字母大写
3 ,变量名的第一个单词小写,后面的单词首字母大写,不允许第一个字符是大写且第二个字符是小写的情况
变量名与其get/set的映射关系如下所示:
属性名/类型 | getter 方法 | setter 方法 |
xcoordinate/Double | public Double getXcoordinate() | public void setXcoordinate(Double newValue) |
xCoordinate/Double | public Double getxCoordinate() | public void setxCoordinate(Double newValue) |
XCoordinate/Double | public Double getXCoordinate() | public void setXCoordinate(Double newValue) |
Xcoordinate/Double | 不允许 | 不允许 |
student/Boolean | public Boolean getStudent() | public void setStudent(Boolean newValue) |
student/boolean | public boolean getStudent() public boolean isStudent() | public void setStudent(boolean newValue) |