This appears cumbersome and ineffective (when the structures get long and complex). Is there another way?

(NB: please disregard any syntax errors as this is only sample code created for this question. Also, I am aware a String is somethign else than a character pointer pointing into the data segment. However, the argument works with primitive data types as well).

You're right, this will work. Of course, access will be via indices, and you loose all type information, so this can only be a workaround in very simple cases (when the performance benefit is negligible).
–
MartinNov 15 '12 at 12:43

You can iterate an array. Just curious, have you looked at enums?
–
FrisoNov 15 '12 at 21:06

If the data structure is really really messy and complicated, and you really don't want to "clutter" you code with it, you could create it in a totally separate little program, and serialize/save it to disk. Your "real" program just deserializes/reads it.

Of course, this really obscures what is going on so I'd avoid this technique unless you really need it.

If the problem is only that the initial load speed of the app is slow, you can defer static initializers using the Holder Pattern