bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
Learn/Java/Java Reference
Java•Java Reference

Java LinkedList Methods

All LinkedList Methods

A list of all LinkedList methods can be found in the table below.

Some methods use the type of the LinkedList's items as a parameter or return value. This type will be referred to as T in the table.

MethodDescriptionReturn Type
add()Add an item to the listbooleanvoid
addAll()Add a collection of items to the listboolean
addFirst()Adds an item to the beginning of the listvoid
addLast()Adds an item to the end of the listvoid
clear()Remove all items from the listvoid
clone()Create a copy of the LinkedListObject
contains()Checks whether an item exist in the listboolean
descendingIterator()Returns an iterator to loop through the items of the list in reverse order
element()Retrieves the first item in the list Similar to getFirst()
forEach()Perform an action on every item in the listvoid
get()Return the item at a specific position in the listT
getFirst()Returns the first item in the listT
getLast()Returns the last item in the listT
indexOf()Return the position of the first occurrence of an item in the listint
isEmpty()Checks whether the list is emptyboolean
iterator()Return an Iterator object for the LinkedListIterator
lastIndexOf()Return the position of the last occurrence of an item in the listint
listIterator()Return a ListIterator object for the LinkedListListIterator
offer()Adds an item at the end of the list
offerFirst()Adds an item at the beginning of the list
offerLast()Adds an item at the end of the list
peek()Retrieves the first item in the list Similar to getFirst()
peekFirst()Retrieves the first item in the list. Similar to peek()
peekLast()Retrieves the last item in the list
poll()Retrieves and removes the first item in the list.
pollFirst()Retrieves and removes the first item in the list. Similar to poll()
pollLast()Retrieves and removes the last item in the list.
pop()Returns the first element in the list. Similar to removeFirst()
push()Adds an item to the beginning of the list. Similar to addFirst()
remove()Remove an item from the listbooleanT
removeAll()Remove a collection of items from the listboolean
removeFirst()Removes the first item in the listT
removeFirstOccurrence()Removes the first occurrence of a specified item in the list
removeIf()Remove all items from the list which meet a specified conditionboolean
removeLast()Removes the last item in the listT
removeLastOccurrence()Removes the last occurrence of a specified item in the list
replaceAll()Replace each item in the list with the result of an operation on that itemvoid
retainAll()Remove all elements from the list which do not belong to a specified collectionboolean
set()Replace an item at a specified position in the listT
size()Return the number of items in the listint
sort()Sort the listvoid
spliterator()Return a Spliterator object for the LinkedListSpliterator
subList()Return a sublist which provides access to a range of this list's itemsList
toArray()Return an array containing the list's itemsObject[]

Previous

Java ArrayList trimToSize() Method

Next

Java LinkedList add() Method

This chapter

Overview
264

Lessons

546m

Read time

1. Java Keywords2. Java assert Keyword3. Java abstract Keyword4. Java boolean Keyword5. Java break Keyword6. Java byte Keyword7. Java case Keyword8. Java catch Keyword9. Java char Keyword10. Java class Keyword11. Java continue Keyword12. Java default Keyword13. Java do Keyword14. Java double Keyword15. Java else Keyword16. Java enum Keyword17. Java exports Keyword18. Java extends Keyword19. Java final Keyword20. Java finally Keyword21. Java float Keyword22. Java for Keyword23. Java if Keyword24. Java implements Keyword25. Java import Keyword26. Java instanceof Keyword27. Java int Keyword28. Java interface Keyword29. Java long Keyword30. Java module Keyword31. Java native Keyword32. Java new Keyword33. Java package Keyword34. Java private Keyword35. Java protected Keyword36. Java public Keyword37. Java return Keyword38. Java requires Keyword39. Java short Keyword40. Java static Keyword41. Java super Keyword42. Java switch Keyword43. Java synchronized Keyword44. Java this Keyword45. Java throw Keyword46. Java throws Keyword47. Java transient Keyword48. Java try Keyword49. Java var Keyword50. Java void Keyword51. Java volatile Keyword52. Java while Keyword53. Java String Methods54. Java String charAt() Method55. Java String codePointAt() Method56. Java String codePointBefore() Method57. Java String codePointCount() Method58. Java String compareTo() Method59. Java String compareToIgnoreCase() Method60. Java String concat() Method61. Java String contains() Method62. Java String contentEquals() Method63. Java String copyValueOf() Method64. Java String endsWith() Method65. Java String equals() Method66. Java String equalsIgnoreCase() Method67. Java String format() Method68. Java String getBytes() Method69. Java String getChars() Method70. Java String hashCode() Method71. Java String indexOf() Method72. Java String isEmpty() Method73. Java String join() Method74. Java String lastIndexOf() Method75. Java String length() Method76. Java String matches() Method77. Java String offsetByCodePoints() Method78. Java String regionMatches() Method79. Java String replace() Method80. Java String replaceAll() Method81. Java String replaceFirst() Method82. Java String split() Method83. Java String startsWith() Method84. Java String subSequence() Method85. Java String substring() Method86. Java String toCharArray() Method87. Java String toLowerCase() Method88. Java String toString() Method89. Java String toUpperCase() Method90. Java String trim() Method91. Java String valueOf() Method92. Java Math Methods93. Java Math abs() Method94. Java Math acos() Method95. Java Math addExact() Method96. Java Math asin() Method97. Java Math atan() Method98. Java Math atan2() Method99. Java Math cbrt() Method100. Java Math ceil() Method101. Java Math copySign() Method102. Java Math cos() Method103. Java Math cosh() Method104. Java Math decrementExact() Method105. Java Math exp() Method106. Java Math expm1() Method107. Java Math floor() Method108. Java Math floorDiv() Method109. Java Math floorMod() Method110. Java Math getExponent() Method111. Java Math hypot() Method112. Java Math IEEEremainder() Method113. Java Math incrementExact() Method114. Java Math log() Method115. Java Math log10() Method116. Java Math log1p() Method117. Java Math max() Method118. Java Math min() Method119. Java Math multiplyExact() Method120. Java Math negateExact() Method121. Java Math nextAfter() Method122. Java Math nextDown() Method123. Java Math nextUp() Method124. Java Math pow() Method125. Java Math random() Method126. Java Math rint() Method127. Java Math round() Method128. Java Math scalb() Method129. Java Math signum() Method130. Java Math sin() Method131. Java Math sinh() Method132. Java Math sqrt() Method133. Java Math subtractExact() Method134. Java Math tan() Method135. Java Math tanh() Method136. Java Math toDegrees() Method137. Java Math toIntExact() Method138. Java Math toRadians() Method139. Java Math ulp() Method140. Java Output Methods141. Java Output print() Method142. Java Output printf() Method143. Java Output println() Method144. Java Arrays Class145. Java Arrays. compare() Method146. Java Arrays. equals() Method147. Java Arrays. sort() Method148. Java Arrays. fill() Method149. Java Array length Property150. Java ArrayList Methods151. Java ArrayList add() Method152. Java ArrayList add() Method153. Java ArrayList clear() Method154. Java ArrayList clone() Method155. Java ArrayList contains() Method156. Java ArrayList ensureCapacity() Method157. Java ArrayList forEach() Method158. Java ArrayList get() Method159. Java ArrayList indexOf() Method160. Java ArrayList isEmpty() Method161. Java ArrayList iterator() Method162. Java ArrayList lastIndexOf() Method163. Java ArrayList listIterator() Method164. Java ArrayList remove() Method165. Java ArrayList removeAll() Method166. Java ArrayList removeIf() Method167. Java ArrayList replaceAll() Method168. Java ArrayList retainAll() Method169. Java ArrayList set() Method170. Java ArrayList size() Method171. Java ArrayList sort() Method172. Java ArrayList spliterator() Method173. Java ArrayList subList() Method174. Java ArrayList toArray() Method175. Java ArrayList trimToSize() Method176. Java LinkedList Methods177. Java LinkedList add() Method178. Java LinkedList add() Method179. Java LinkedList clear() Method180. Java LinkedList clone() Method181. Java LinkedList contains() Method182. Java LinkedList forEach() Method183. Java LinkedList get() Method184. Java LinkedList getFirst() Method185. Java LinkedList getLast() Method186. Java LinkedList indexOf() Method187. Java LinkedList isEmpty() Method188. Java LinkedList iterator() Method189. Java LinkedList lastIndexOf() Method190. Java LinkedList listIterator() Method191. Java LinkedList remove() Method192. Java LinkedList removeAll() Method193. Java LinkedList removeFirst() Method194. Java LinkedList removeIf() Method195. Java LinkedList removeLast() Method196. Java LinkedList replaceAll() Method197. Java LinkedList retainAll() Method198. Java LinkedList set() Method199. Java LinkedList size() Method200. Java LinkedList sort() Method201. Java LinkedList spliterator() Method202. Java LinkedList subList() Method203. Java LinkedList toArray() Method204. Java HashMap Methods205. Java HashMap clear() Method206. Java HashMap clone() Method207. Java HashMap compute() Method208. Java HashMap computeIfAbsent() Method209. Java HashMap computeIfPresent() Method210. Java HashMap containsKey() Method211. Java HashMap containsValue() Method212. Java HashMap entrySet() Method213. Java HashMap forEach() Method214. Java HashMap get() Method215. Java HashMap getOrDefault() Method216. Java HashMap isEmpty() Method217. Java HashMap keySet() Method218. Java HashMap merge() Method219. Java HashMap put() Method220. Java HashMap putAll() Method221. Java HashMap putIfAbsent() Method222. Java HashMap remove() Method223. Java HashMap replace() Method224. Java HashMap replaceAll() Method225. Java HashMap size() Method226. Java HashMap values() Method227. Java Scanner Methods228. Java Scanner close() Method229. Java Scanner delimiter() Method230. Java Scanner findInLine() Method231. Java Scanner findWithinHorizon() Method232. Java Scanner hasNext() Method233. Java Scanner hasNextBoolean() Method234. Java Scanner hasNextByte() Method235. Java Scanner hasNextDouble() Method236. Java Scanner hasNextFloat() Method237. Java Scanner hasNextInt() Method238. Java Scanner hasNextLine() Method239. Java Scanner hasNextLong() Method240. Java Scanner hasNextShort() Method241. Java Scanner locale() Method242. Java Scanner next() Method243. Java Scanner nextBoolean() Method244. Java Scanner nextByte() Method245. Java Scanner nextDouble() Method246. Java Scanner nextFloat() Method247. Java Scanner nextInt() Method248. Java Scanner nextLine() Method249. Java Scanner nextLong() Method250. Java Scanner nextShort() Method251. Java Scanner radix() Method252. Java Scanner reset() Method253. Java Scanner useDelimiter() Method254. Java Scanner useLocale() Method255. Java Scanner useRadix() Method256. Java File Class Methods257. Java FileInputStream Methods258. Java FileOutputStream Methods259. Java BufferedReader Methods260. Java BufferedWriter Methods261. Java Iterator Interface262. Java Collections Class Methods263. Java System Methods264. Java Errors and Exception Types