Home / CSE MCQs / JAVA MCQs :: Discussion

Discussion :: JAVA MCQs

  1. Which of these methods can convert an object into a List?
  2. A.
    SetList()
    B.
    ConvertList()
    C.
    singletonList()
    D.
    CopyList()

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    singletonList() returns the object as an immutable List. This is a easy way to convert a single object into a list. This was added by Java 2.0.


Be The First To Comment