How does an array’s equal method work?

Basically, array types don’t override equals to provide value equality… so you end up with the default implementation in Object, which is reference equality.

For value equality in arrays (i.e. equal elements in the same order), use the static methods in the Arrays class.

Leave a Comment