#356 Adding a New Value to an enum

Companies:
AxbitGroup
Themes:
SpringSpring Data JPACode Review

A model contains the following enum:

public enum AccountType {
    TYPE_ONE,
    TYPE_INO
}

It is used to specify a type in an entity:

@Enumerated
private AccountType accountType;

A new type TYPE_ONE_AND_HALF had to be added to the enum, so the following change was made:

public enum AccountType {
    TYPE_ONE_AND_HALF,
    TYPE_ONE,
    TYPE_INO
}

Is this solution correct, and what problems may arise?

Question review

Mentor
Answer as you would in a real interview. I’ll ask follow-up questions, then compare your answer with the reference answer and show your accuracy as a %.
Sign in to start the dialogue The mentor keeps the context of the current question and your previous messages.
Sign in