Oddities of Java: Arrays are objects, kind of, but also primitives
Briefly

In Java, integer variables declared with 'int' are primitive types, while integer arrays created with 'int[]' are considered objects. This distinction allows arrays to use methods from the Object class. However, when attempting to display the contents of an integer array using the toString() method, the output is unsatisfactory. To obtain a more useful representation, developers must either implement their own iteration method or rely on utility functions from the java.util package, such as the Arrays class, which offers necessary static tools for handling arrays effectively.
The Java 'int' is a primitive type, while an integer array declared with 'int[]' is an object, meaning it can utilize Object methods.
When you call toString() on an integer array, the result is not user-friendly, necessitating custom iteration or importing utility methods.
Read at Medium
[
|
]