Question: what is the difference between add and addall in list in java?
Answer: The method add() adds one item to your ArrayList , in this case another ArrayList . The method addAll() adds all items from one ArrayList to another. add is used when you need to add single element into collection. addAll is used when you want to add all elements from source collection to your collection.