I am a newbie to java, i want to learn about the native typesafe enum patterns? can anybody help me?
thanks in advance..
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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
enumtypes (tutorial link), there is no real need to know how to do this. Just use nativeenumtypes.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.)