Friday, August 13, 2004 07:19 AM
I believe that you are misinterpreting what you are seeing
as the "value" of your byte array.
The String "[B@2aa02aa0" is actually showing you two
things: the "[B" indicates that the array is an array of
bytes. The "@" separates the type of array from the other
part, which is the hashcode of the array itself.
If you check "reference_array.length", I think you'll get
something other than 11 (unless it's a real coincidence).
In Java, array elements are accessed like this:
ar is the array
i is the index into the array.
If the array is an array of arrays, you can access
the innermost elements like this:
ar is the array,
the index into the outer-most array, and
is the index into the inner-most array.
Hope that helps,