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)

Please log in or register to answer this question.

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
asked Oct 24, 2021 in Education by JackTerrance
0 votes
asked Oct 24, 2021 in Education by JackTerrance
0 votes
asked Oct 23, 2021 in Education by JackTerrance
...