---
spec: JLS
title: "The Java Language Specification"
edition: "Java SE 23 Edition"
java_version: 23
chapter: "Chapter 13. Binary Compatibility"
section: "13.4.26"
heading: "13.4.26. Evolution of Enum Classes"
parent: "13.4. Evolution of Classes"
source: https://docs.oracle.com/javase/specs/jls/se23/html/jls-13.html#jls-13.4.26
id: "13.4.26"
url: https://jvm.obfuscated.software/jls/se23/13.4.26.html
raw: https://jvm.obfuscated.software/jls/se23/13.4.26.md
---

# 13.4.26. Evolution of Enum Classes

Adding or reordering enum constants in an enum class will not break compatibility with pre-existing binaries.

As with `sealed` classes ([§13.4.2.1](13.4.2.1.md)), although adding an enum constant to an enum class is considered a binary compatible change, it may cause the execution of an exhaustive `switch` ([§14.11.1](14.11.1.md)) to fail if the `switch` encounters the new enum constant that was not known at compile time ([§14.11.3](14.11.3.md), [§15.28.2](15.28.2.md)).

Deleting an enum constant from an enum class will delete the `public` field that corresponds to the enum constant ([§8.9.3](8.9.3.md)). The consequences are specified in [§13.4.8](13.4.8.md). Such a change is not recommended for widely distributed enum classes.

In all other respects, the binary compatibility rules for enum classes are identical to those for normal classes.
