0

I have created Enum like this:So I want to add another enum while my application is running eg:"BLOCKED"..Please Help.

public enum LoginStatus {

LOGGEDIN("LOGGEDIN", "Loggedin"),

LOGOUT("LOGOUT", "Logout");

private final String value;
private final String description;

LoginStatus(String value, String description) {
    this.value = value;
    this.description = description;
}


public String value() {
    return this.value;
}


public String getReasonPhrase() {
    return this.description;
}

@Override
public String toString() {
    return this.value;
}
}
Munal Dhakal
  • 37
  • 1
  • 10

1 Answers1

0

You cannot create enums at runtime. Enums present a fixed constant, you must define them in source code.

1615903
  • 32,635
  • 12
  • 70
  • 99