Home / CSE MCQs / JAVA MCQs :: Discussion

Discussion :: JAVA MCQs

  1. Which of these method is used to reduce the capacity of an ArrayList object?
  2. A.
    trim()
    B.
    trimSize()
    C.
    trimTosize()
    D.
    trimToSize()

    View Answer

    Workspace

    Answer : Option D

    Explanation :

    trimTosize() is used to reduce the size of the array that underlines an ArrayList object.


Be The First To Comment