File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Equality 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 "Equality " Watch "Equality " New topic
Author

Equality

Ramesh Sahu
Ranch Hand

Joined: Jul 14, 2008
Posts: 32
If two equal objects are in an array and that array is sorted, the equal elements may change their order.
true/false
Sandeep Bhandari
Ranch Hand

Joined: Apr 16, 2004
Posts: 201
my take would be true as we don't know which algorithm is java going to use to sort the array.


SCJP 96% | SCWCD 90%| SCJP mock exams | My SCJP blog
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

and that array is sorted


Sorted how ? Using a java utility method or custom sorts ? There is no answer to this question.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Sandeep Bhandari
Ranch Hand

Joined: Apr 16, 2004
Posts: 201
arrays can be sorted using Arrays utility class
Harshit Rastogi
Ranch Hand

Joined: Apr 15, 2008
Posts: 131
Originally posted by Sandeep Bhandari:
my take would be true as we don't know which algorithm is java going to use to sort the array.


its uses merge sort


My Techie Blog - Java Questions
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

Originally posted by Sandeep Bhandari:
arrays can be sorted using Arrays utility class


The question does not mention the use of the Arrays class
Sandeep Bhandari
Ranch Hand

Joined: Apr 16, 2004
Posts: 201
in exam situation, we can't say that question is wrong. At least give it an attempt.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Equality