exam questions

Exam 1z0-804 All Questions

View all questions & answers for the 1z0-804 exam

Exam 1z0-804 topic 1 question 29 discussion

Actual exam question from Oracle's 1z0-804
Question #: 29
Topic #: 1
[All 1z0-804 Questions]

Given the integer implements comparable:

What is the result?

  • A. 4
  • B. 1
  • C. 32
  • D. 21
  • E. 2
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️
binarySearch
public static <T> int binarySearch(List<? extends Comparable<? super T>> list, T key)
Searches the specified list for the specified object using the binary search algorithm.
The list must be sorted into ascending order according to the natural ordering of its elements (as by the sort (List) method) prior to making this call. If it is not sorted, the results are undefined.
Parameters:
list - the list to be searched.
key - the key to be searched for.
Returns:
the index of the search key, if it is contained in the list; otherwise, (-(insertion point) - 1).

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Currently there are no comments in this discussion, be the first to comment!
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...