How Is Enum Data Stored In Memory?

2

2 Answers

Florio Potter Profile
Florio Potter answered

That enum exists only in the memory of the compiler, not the executeable. You'll have to create an instance of the enum for it to appear in the executable. In Java, there should only be one instance of each of the values of your enum in memory. A reference to the enum then requires only the storage for that reference. Checking the value of an enum is as efficient as any other reference comparison. You would only worry about this when storing large quantities of enums. For more information get help at

CodeAvail- Online Computer Science Assignment
help

Aun Jafery Profile
Aun Jafery answered
Enum data refers to enumerated data that means data that can take values based on a pre-defined set. Examples of enum names include John, Mary, and Susan etc. Enumerated data only supports assignment and relational type of operations. Enumerated data requires being stored in a space efficient manner. HDF is used to store enumerated data in the form of integers. The application is thus allowed to choose the format and size of the said integers. It is unimportant as to which order members are inserted. The association the values have with the respective symbols is considered much more important. Two different enumerated data types have to have equal data types of their underlying integers and a similar symbol and value association to be considered equal.

Answer Question

Anonymous