Link Details

Unfortunately Arrays both primitive and Object does not implement equals() method, despite Array being object, so you can not compare them either using == operator or equals() method. Thankfully java.util.Arrays class provides two ways to compare Array in Java, one using Arrays.equals() and other using deepEquals(). There is big difference between equals() and deepEquals() in Java while comparing Arrays. This article explores when to use equals and deepEquals to compare Array.

Posted by screener  |   Jan 07 2013 / 00:20

Add your comment

Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Recommended Links

Written by: Ryan Knight
Featured Refcardz: Top Refcardz:
  1. Apache Hadoop
  2. Play
  3. Akka
  4. Debugging JavaScript
  5. Design Patterns
  1. Apache Hadoop
  2. REST
  3. Java
  4. Git
  5. Java Performance
Connect with DZone