Skip to content

Glossary: Java Beyond the Basics

values, valueOf, ordinal

Also written: values(), valueOf, ordinal(), name()

Enum methods: values() lists all constants in order, valueOf turns exact text into a constant (or throws), ordinal() gives its position from 0, and name() gives its name as a string.

Where the book teaches it

Related terms

Enum