This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes K&B Book Chapter 7,Page  616,Question 9 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "K&B Book Chapter 7,Page  616,Question 9" Watch "K&B Book Chapter 7,Page  616,Question 9" New topic
Author

K&B Book Chapter 7,Page 616,Question 9

Ankit Chandrawat
Ranch Hand

Joined: Jan 03, 2008
Posts: 78
Hi,

Question says:Given a properly prepared String array containing five elements,which range of results could a proper invocation of Arrays.binarySearch() produce?

A. 0 through 4
B. 0 through 5
C. -1 through 4
D. -1 through 5
E. -5 through 4
F. -5 through 5
G. -6 through 4
H. -6 through 5

Output is G ie -6 through 4.My doubt is why the range starts from -6.

Thanks in advance.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

This question is explained here.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: K&B Book Chapter 7,Page 616,Question 9
 
Similar Threads
binary search
Chap 7 pg 628 from kathy & Sierra
k&b scjp5, page no 616, problem no 9
Kathy Sierra doubt
K&B page 628 question 9