本帖最后由 刘芮铭 于 2012-8-30 15:13 编辑
- public enum RefelctEnum {
- FIRST(5, false),SECOND(3, false),THIRD(6,ture);
- int number;
- Boolean isrequired;
-
- private RefelctEnumm(int number, Boolean isrequired) {
- this.number = number;
- this.isrequired = isrequired;
- }
- public int getNumber() {
- return number;
- }
-
- public void setNumber(int number) {
- this.number = number;
- }
- public Boolean getIsrequired() {
- return isrequired;
- }
-
- public void setIsrequired(Boolean isrequired) {
- this.isrequired = isrequired;
- }
-
- }
复制代码 我想通过反射得到Reflect.FIRST.getIsrequired();可以一用到newInstance()就会错?为什么?
|
|