Hi, Can anyone help me out with this ? Which of these methods from the Collection interface return the value true if the collection object was actually modified by the call? a. add() b. retainAll() c. containsAll() d. contains() e. remove()
answer: add(), retain(), retainAll(), and remove() although contains() and containsAll() also return a boolean value, the point to remember here is that the question asks for methods that return true AFTER modification HTH chetan
add() - Returns true if this collection changed as a result of the call. retainAll() - Return true if this collection changed as a result of the call contains() - Returns true if this collection contains the specified element containsAll() - Returns true if this collection contains all of the elements in the specified collection. remove() - Returns true if this collection changed as a result of the call Ada