| Author |
k&b scjp5, page no 616, problem no 9
|
Mukesh Gulia
Greenhorn
Joined: Sep 09, 2008
Posts: 2
|
|
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 ans is G. i thought answer is be E range can be ((-5) -1) through 4 i.e. 4 to 4 negative result give insertion point(array index). please confirm.
|
 |
Brij Garg
Ranch Hand
Joined: Apr 29, 2008
Posts: 234
|
|
If you know
range can be ((-5) -1) through 4 i.e. 4 to 4
then range is -6 to 4.
|
 |
sweety sinha
Ranch Hand
Joined: Jul 07, 2008
Posts: 76
|
posted

0
|
............................................................................ range can be ((-5) -1) through 4 i.e. ((-5)+(-1))= (-5-1)= -6 i.e range can be -6 through 4 you did a slight mistake in adding.
|
 |
Mukesh Gulia
Greenhorn
Joined: Sep 09, 2008
Posts: 2
|
|
yeah yeah thanks all
|
 |
 |
|
|
subject: k&b scjp5, page no 616, problem no 9
|
|
|