Java Enums PDF
Java Enums PDF
1. Overview
Java enums are enhanced with generics support and with the ability to
add methods to individual items, a new JEP shows. Since both features
can be delivered with the same code change, they are bundled together
in the same JEP. The change only affects the Java compiler, and
therefore no runtime changes are needed.
Now these keys can be safely retrieved and stored from and into the
properties store, since expressions like the following will fail to compile:
put(PORT, “not a number”); // error, type mismatch: PORT is Key<Integer>
// “not a number” is String
2. Enums and Inheritance