in Education by
Which of these is an incorrect form of using method max() to obtain a maximum element? (a) max(Collection c) (b) max(Collection c, Comparator comp) (c) max(Comparator comp) (d) max(List c) This question was addressed to me during an interview. This question is from Collection Algorithms in division java.util – The Collections Framework of Java Select the correct answer from above options JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
The correct choice is (c) max(Comparator comp) To explain: Its illegal to call max() only with comparator, we need to give the collection to be searched into.

Related questions

0 votes
    Which of these statement is incorrect? (a) A thread can be formed by implementing Runnable interface only ( ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Which of these methods can be used to obtain the coordinates of a mouse? (a) getPoint() (b) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Which of the following is an incorrect statement about packages? (a) Package defines a namespace in which ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
0 votes
    Which of these methods sets every element of a List to a specified object? (a) set() (b) fill() ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these method of Array class is used sort an array or its subset? (a) binarysort() (b) ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these is an correct way of defining generic method? (a) name(T1, T2, , Tn) { /* ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Which is not the way to query a document for an element or elements? (a) With a specified id ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 22, 2021 in Education by JackTerrance
0 votes
    Which of these operator is used to generate an instance of an exception than can be thrown by using throw ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 25, 2021 in Education by JackTerrance
...