Returning null + removing operations: poll()
, pollFirst()
.
Returning null + not removing operations: peek()
, peekFirst()
.
Throwing exception + removing operations: pop()
, remove()
, removeFirst()
.
Throwing exception + not removing operations: element()
, getFirst()
.
reference: http://stackoverflow.com/questions/14851367/java-linkedlist-differences-between-retrieve-operations