Collections


  1. Which of this method is used to change an element in a LinkedList Object?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    An element in a LinkedList object can be changed by first using get() to obtain the index or location of that object and the passing that location to method set() along with its new value.


  1. Which of these methods can be used to delete the last element in a LinkedList object?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    removeLast() and removeFirst() methods are used to remove elements in end and beginning of a linked list.



  1. Which of these method of HashSet class is used to add elements to its object?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    add()


  1. Which of these method is used to add an element to the start of a LinkedList object?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    addFirst()



  1. Which of these classes implements Set interface?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    HashSet and TreeSet implements Set interface where as LinkedList and ArrayList implements List interface.