Collections


  1. Which of these method is used to reduce the capacity of an ArrayList object?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

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


  1. Which of these methods can be used to obtain a static array from an ArrayList object?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    toArray()



  1. Which of these method of ArrayList class is used to obtain present size of an object?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    size()


  1. Which of these method can be used to increase the capacity of ArrayList object manually?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    When we add an element, the capacity of ArrayList object increases automatically, but we can increase it manually to specified length x by using function ensureCapacity(p);



  1. Which of these class can generate an array which can increase and decrease in size automatically?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    ArrayList()