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.