Is it possible in Java to override a toString for an Objects array?
For example, let's say I created a simple class, User (it doesn't really matter which class is it since this is a general question). Is it possible that, once the client creates a User[] array and the client uses System.out.print(array), it won't print the array's address but instead a customized toString()?
PS: of course I can't just override toString() in my class since it's related to single instances.
java.util.Arrays.toString(array).Object[].toString()does not return the "address" of the array. It returns the arrays identity hash code.