It's not a secret anymore!
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Inquisition Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Inquisition Question" Watch "Inquisition Question" New topic
Author

Inquisition Question

Chandana Garlapati
Ranch Hand

Joined: Jul 06, 2009
Posts: 97


why the above code prints false???
Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
Because int[] does not override the equals method.

By default equals method returns true if both the reference are pointing to the same object whcih is not in your case.

To compare arrays use Arrays.equals(arr,arr) method.


SCJP 6,SCWCD 5,SCBCD 5

Failure is not an option.
Chandana Garlapati
Ranch Hand

Joined: Jul 06, 2009
Posts: 97
Thanks Siva.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Inquisition Question
 
jQuery in Action, 3rd edition