what if i have an array of strings ,
how will it memory be alocated and each element take a different size
An "array of strings" is allocated as a special kind of object consisting of
n elements. Those elements are String
references (e.g., "pointers" to the String objects), not the String objects themselves.
One of the "nice" things about
Java is that you don't have to manage this allocation (or any memory, for that matter). The JVM takes care of the nasty details.
[ September 06, 2005: Message edited by: Steve Morrow ]