enum with numbers java
public enum EXIT_CODE {
A(104), B(203);
private int numVal;
EXIT_CODE(int numVal) {
this.numVal = numVal;
}
public int getNumVal() {
return numVal;
}
}
enum with numbers java
public enum EXIT_CODE {
A(104), B(203);
private int numVal;
EXIT_CODE(int numVal) {
this.numVal = numVal;
}
public int getNumVal() {
return numVal;
}
}
enum with methods in java example
public enum Level {
HIGH{
@Override
public String asLowerCase() {
return HIGH.toString().toLowerCase();
}
},
MEDIUM{
@Override
public String asLowerCase() {
return MEDIUM.toString().toLowerCase();
}
},
LOW{
@Override
public String asLowerCase() {
return LOW.toString().toLowerCase();
}
};
public abstract String asLowerCase();
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us