0

I have an integer and an integer that I get from a hashmap stored in an array called finalAns.

int[] finalAns = {};
finalAns = new int[]{1, 3};
System.out.println(finalAns);

When I print it out I get [I@77459877

How do I get [1,3] when I print out the final answer (System.out.println(finalAns))?

  • By the way, most of that code is irrelevant. You could just have said you have an array `int[] finalAns = new int[]{1, 3};`. Please read about [**Minimal**, Complete, and Verifiable Examples](http://stackoverflow.com/help/mcve). – Federico klez Culloca Jul 13 '22 at 06:56
  • `Arrays.toString(array)`. What you see here is the default `toString()` representation of arrays, or Objects in particular. – Zabuzard Jul 13 '22 at 06:57

0 Answers0