+ 5
LinkedList Method
I would like to know the difference between .add() method and the .offer() method. Thanks!!
1 ответ
+ 9
Although they are very similar they aren't the same. There is a difference in the interfaces that are used within the methods, but the most substantial difference to you would be that if the add method can not add the item to the list an error will be thrown, whereas the offer method would not. The non-positional add method and the addLast method are however, the same.