enum.values() – is an order of returned enums deterministic

The Java language specification uses this explicit language:

@return an array containing the constants of this enum type, in the order they’re declared [Source]

So, yes, they will be returned in declaration order. It’s worth noting that the order might change over time if someone changes the class so be very careful about how you use this.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)