2

For example, in my code there is

public enum Color { RED, BLACK }

and I add a color later, that is

public enum Color { RED, BLACK, BLUE }

will this break ABI? That is, does my user need to recompile his Java classes?

Franklin Yu
  • 8,920
  • 6
  • 43
  • 57
  • Idea from [*Does adding enumerators into enum break ABI?*](https://stackoverflow.com/questions/27300561/does-adding-enumerators-into-enum-break-abi). – Franklin Yu Sep 29 '17 at 17:58

1 Answers1

4

No. According to Java Language Specification:

13.4.26. Evolution of Enums

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

Note that even reordering keeps compatibility, unlike in C/C++/C#.

Franklin Yu
  • 8,920
  • 6
  • 43
  • 57