I am a newbie to java, i want to learn about the native typesafe enum patterns? can anybody help me?
thanks in advance..
I am a newbie to java, i want to learn about the native typesafe enum patterns? can anybody help me?
thanks in advance..
Use enum
s; details in the JLS.
i want to know the difference between typesafe enum patterns and native type-safe enum patterns.
A type-safe enum pattern is a design / implementation pattern that provides something similar to native enums. Since, Java 5.0 and later support native enum
types (tutorial link), there is no real need to know how to do this. Just use native enum
types.
If you are curious about how it used to be done, read this: Alternative to enum in Java 1.4
(A native typesafe enum pattern is a contradiction in terms. Java's native enum construct is a first class programming language construct ... not a design pattern.)