Help the world stop coronavirus! Stay home!

Prev Next

Java / Enum

Benefits of using Enums in Java.

Enum provides type-safe; Enum variable can be assigned only with predefined enum constants otherwise it will issue compilation error.

Enum can be used in switch-case Java control statement.

Enum has its own namespace.

Enum constants can hold values specified at the creation time.

Enum can help create a Singleton pattern, which is inherently Thread Safe.

Passing Enum as an argument to the static factory method makes method type safe.

❤Cash Back At Stores you Love !!!❤

Earn your $10 reward when you make your first purchase through Ebates by signing up with clicking below button.

Ebates Coupons and Cash Back

More Related questions...

Show more question and Answers...


Comments & Discussions