Ad
  • Default User Avatar

    Java has two categories of types: primitives and references. An array is a reference type. When you print the array, what you are seeing is a reference which the JVM uses to locate the object in memory. It has nothing to do with the contents of the array.

    To see the contents of the array, you can loop through and print the values. They will show up in the test log.

  • Custom User Avatar

    You can't print an array in Java like that, that's why you see that.

  • Custom User Avatar

    En Java:

    When I tried returning integers (to see what was in the integers array in the test), it gave me:
    expected:<3> but was:<[I@7d3a22a9>

    It is thus not only filled with non-integers, but also it has 2 even numbers and 2 odd numbers. Unsure how can anyone resolve this.