javabean 属性的命名规范中,不允许出现首字母大写,第二个字母小写的情况。当第二个字母大写的时候accessor方法(getter,setter)命名的时候需要特别注意其中的窍门,而且当属性的类型为boolean时,可以用isProperty()代替getProperty()
Property name/type | Get method | Set method |
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 | Not allowed | Not allowed |
student/Boolean | public Boolean getStudent() | public void setStudent(Boolean newValue) |
student/boolean | public boolean getStudent() public boolean isStudent() | public void setStudent(boolean newValue) |