Skip to content

Make Selenium Easy

And Keep It That Way

  • Home
  • Share
  • About Us
  • Toggle search form

#2. What is the difference between ArrayList and LinkedList In Java?

Posted on 03/21/2025 By admin

Both ArrayList and LinkedList classes implement the List interface of Collections framework in Java. We should understand the difference between these two classes and choose what is best during usage. This is also a frequently asked interview question.

  1. ArrayList implements only the List interface while LinkedList implements List and Deque interfaces.
  2. ArrayList is a Resizeable array implementation of the List interface whereas LinkedList is a Doubly-linked list implementation of the List and Deque interfaces.
  3. The default initial capacity of ArrayList is 10. There is no such initial capacity for LinkedList.
  4. We can create an ArrayList with a given size but not possible for LinkedList.
  5. We can use an index to get an element from both ArrayList and LinkedList but the performance of retrieving an element using its index is faster in ArrayList than in LinkedList.
  6. Insertion is faster in LinkedList than an ArrayList. Removal of elements in LinkedList may take less time.
  7. LinkedList provides a method descendingIterator() to iterate it in reverse order but for ArrayList, we need to write our own method or logic.
  8. LinkedList has more memory head than ArrayList because the node of a LinkedList needs to store data as well as the address of the next and previous nodes of LinkedList.

Thanks for reading.

Uncategorized

Post navigation

Previous Post: TestNG Tutorials 50: DataProvider in TestNG – Understand Basics of DataProvider & How It Works
Next Post: Git Tutorial 8 – Git Push – Upload Committed Local Repository Changes To Remote Repository Branch

Related Posts

April 9, 2019 – Make Selenium Easy Uncategorized
REST Assured Tutorial 43 – Get All Keys From A Nested JSON Object Uncategorized
interview java programs Uncategorized
xpathInConsole – Make Selenium Easy Uncategorized
Hierarchy of Selenium Classes and Interfaces – Make Selenium Easy Uncategorized
Frequently Asked Java Programs 31 – Java Program to Find Common Characters in Two Given Strings Uncategorized

Recent Posts

  • How to Set Up Selenium WebDriver with Python Step by Step
  • How to Set Up Selenium WebDriver with Java from Scratch
  • What Is Selenium and Why It Is the Most Popular Test Automation Framework
  • Getting Started with Selenium 4: What Is New and How to Upgrade from Selenium 3
  • Manual Testing

Recent Comments

No comments to show.

Archives

  • April 2026
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • April 2024
  • March 2024
  • February 2024
  • December 2023
  • October 2023
  • August 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • May 2022
  • March 2022
  • October 2021
  • April 2021
  • March 2021
  • January 2021
  • December 2020
  • October 2020
  • September 2020
  • August 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • May 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • January 2018

Categories

  • Getting Started
  • Uncategorized

Copyright © 2026 Make Selenium Easy.

Powered by PressBook Masonry Dark