Results 1 to 3 of 3
Thread: A weird message [[I@ab54eb
- 12-11-2010, 01:47 PM #1
Member
- Join Date
- Dec 2010
- Posts
- 59
- Rep Power
- 0
A weird message [[I@ab54eb
Hi, I have tried to solve this problem but I am also curious about what does this message from the compiler means? [[I@ab54eb
and why is that happens in my case?
I'm trying to write a toString method for a multi dimensional array as this:
public String toString (){
String result ="";
for (int row=0; row<array.length; row++){
for (int column=0; column<array[row].length; column++){
result = array [row] [column] +"\t";
}
}
result = result+"\n";
return result;
}
//Thank you for helping.
-
Is your array variable a multi-dimensional array of Integer objects? You're getting a default toString output from an array, and it suggests possibly a 2-dimensional Integer (or int?) array. Since result is a already the the array item held in a 2-D array, I have to wonder if that array item also holds an array.
Also, to help us help you, please read my link below on how to use code tags.
Much luck!
Edit, it's the toString for a 2D int array, not an Integer array. The first part of the "weird message" above, the "[[I" is the class name of the array.
[[ -- means a 2D array, and
I -- means of an int.
The second part of the "weird message" -- "@ab54eb", is '@' followed by the hashCode representation of the object in hex notation. This is likely the internal address of the array object, but not necessarily.
You can read up on all this in the API for Object: http://download.oracle.com/javase/6/...ng/Object.htmlLast edited by Fubarable; 12-11-2010 at 02:29 PM.
- 12-12-2010, 08:05 PM #3
Member
- Join Date
- Dec 2010
- Posts
- 59
- Rep Power
- 0
Similar Threads
-
java message box, how to not show multiple message box with same title or content
By oohay in forum AWT / SwingReplies: 6Last Post: 06-04-2010, 08:43 PM -
Weird output
By gandalf5166 in forum New To JavaReplies: 2Last Post: 02-28-2010, 09:17 PM -
weird problem
By GPB in forum New To JavaReplies: 2Last Post: 02-28-2010, 12:04 PM -
Seriously weird output
By gandalf5166 in forum Java AppletsReplies: 4Last Post: 02-27-2010, 04:16 AM -
Weird Error?
By sciguy77 in forum New To JavaReplies: 4Last Post: 01-20-2009, 02:32 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks