CS 3304: Comparative Languages
Data Types
[
Course Documents
] : [
Data Types
]
Previous
Contents
Next
Keyword Index
Enumeration Types
The user enumerates all of the possible values, which are symbolic constants
Design Issue: Should a symbolic constant be allowed to be in more than one type definition?
Examples:
Pascal--cannot reuse constants; they can be used for array subscripts, for variables, case selectors; no input or output; can be compared
Ada--constants can be reused (overloaded literals); can be used as in Pascal; input and output supported
C and C++--like Pascal, except they can be input and output as integers
Java does not include an enumeration type