Home / CSE MCQs / JAVA MCQs :: Discussion

Discussion :: JAVA MCQs

  1. Which of these is an incorrect form of using method max() to obtain maximum element?
  2. A.
    max(Collection c)
    B.
    max(Collection c, Comparator comp)
    C.
    max(Comparator comp)
    D.
    max(List c)

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    Its illegal to call max() only with comparator, we need to give the collection to be serched into.


Be The First To Comment