Hi all,

In many classes, to detect the need of array-resizing, we try to access a
specific position, and do the resizing when
"ArrayIndexOutOfBoundsException" is caught (or NullPointerException for
multidimensional arrays).

But my understanding is that throw-catch exceptions is much more expensive
than get the array size directly: arrayVal.length. So there would be a big
performance hit if we resize arrays frequently. (In fact, we do resize
StringPool very often.)

So could anyone explain to me why it's designed this way?

Thanks,
Sandy Gao
Software Developer, IBM Canada
(1-416) 448-3255
[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to