Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: wordsmithing in intro

...

Wiki Markup
According to the Java API \[[API 2006|AA. Bibliography#API 06]\], {{ordinal()}} is defined as
{{

public

...

final

...

int

...

ordinal

...

()

...

...

Returns the ordinal of the enumeration constant (its position in its enum declaration, where the initial constant is assigned an ordinal of zero). Most programmers will have no use for this method. It is designed for use by sophisticated enum-based data structures, such as EnumSet and EnumMap.

It defines use of The ordinal() as function is also a helper function to sophisticated enum-based data-structures EnumSet and EnumMap.

Poor understanding of program design involving ordinal() can cause programs to behave erroneously.

...