This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 6661
    
    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


<a href="http://technologiquepanorama.wordpress.com" target="_blank" rel="nofollow">My Techie Blog</a><br /><a href="http://www.java-questions.com" target="_blank" rel="nofollow">Java Questions</a>
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    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
 
Similar Threads
compare object
juice
Doubt in Array Declaration
Just a simple for loop question
How do I can compare two arraylists?