I try and look for questions that are similar to mine for almost 2 days, I hope that I find out the answer, but no, I couldnβt, I decided to ask you guys here.
This method is designed to print all keys and values HashMap<String, int[]> ratingmap. So, keys String, and values ββare arrays. I worked on this, and below is my code.
public void showRatingsMap() {
for (String customer: ratingmap.keySet()) {
String key = customer.toString();
int[] value = ratingmap.get(key);
System.out.println("Customer: " + key + " - Rating: " + value);
}
}
I am really confused at the moment, because the printed result is as follows:
Customer: Douglas Anderson - Rating: [I@4f5b571e
Customer: Sidney - Rating: [I@75b49b45
Customer: Apollo - Rating: [I@243e0b62
Customer: Leslie - Rating: [I@655d6184
Since I expect the rating to be an array, but it always looks like a weird combination above: [I @ 2b9fd66a
Can someone point out errors that cause the problem?
source
share