Originally posted by payal sharma:
Which of the following methods return �true� if the Collection object is modified during the operation?
<snip>
Here what is meant by Collection object modified during the operation?
I would guess that the question is just looking for the methods that actually change the Collection. In other words, which methods alter what the Collection holds? Once you answer that, you can figure out if those methods return a boolean value.\
From the API, the methods that could change the Collection AND return a boolean value are:
add(), addAll(), remove(), removeAll(), and retainAll()
clear() removes all the elements from the Collection, but does not return a boolean.
contains(), containsAll(), equals(), and isEmpty() all return a boolean, but they're just reporting information about the Collection, not changing anything about the collection.
April