Thursday, August 25, 2011

Java Storage

Some of the places where data is stored when we have a java programme running.

1. Registers
2. Stack
3. Heap --- Java Objects
4. Hard Disk --- Serialized objects

Thursday, August 18, 2011

Use of Enums

When to use an Enum ?
When we have a fixed set of values which are known at compile-time.
Example would be to enumerate days of the week (cant have "funday") and to have a collection of SSN
When the elements are known up front and won't change, an enum is appropriate.
If the elements can change during runtime, use a Set.