Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6475649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:43:49+00:00 2026-05-25T06:43:49+00:00

Possible Duplicate: When to use LinkedList<> over ArrayList<>? I saw the API for the

  • 0

Possible Duplicate:
When to use LinkedList<> over ArrayList<>?

I saw the API for the ArrayList and LinkedList and it seems to be same. Apart from their performance difference is there any difference in terms of adding, deleting and iterating the List.

List arrList = new ArrayList();

List linList = new LinkedList();

The List arrList or linList reference is actually implementing the corresponding class. What does this actually mean?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:43:49+00:00Added an answer on May 25, 2026 at 6:43 am

    I am not 100% sure what you mean when you ask “What does this actually mean?”, but here is a guess.

    Consider code like this:

    interface Interface
    {
       void foo();
    }
    
    class Implementation
        implements Interface
    {
        public void foo() { }
        public void bar() { }
    }
    
    public class Main
    {
        public static void main(final String[] argv)
        {
            Interface a;
            Implementation b;
    
            a = new Implementation();
            b = a;
    
            a.foo();
            b.foo();
            a.bar(); <-  won't compile
            b.bar();
        }
    }
    

    Interface a; and Implementation b; both point at the same object, but only the reference to “b” has access to the “bar” method.

    So, in your example, any methods that are in the List interface are accessible to both arrList and linList, but any methods that they provide in addition to the List interface wont be callable without a cast. You can (and should in most cases) treat ArrayList and LinkedList as a List.

    For the specifics of inserting/adding/deleting from the different lists, you generally should not care. Both behave the same way from the point of view of the end result (eg. the same sequence of method calls with the same data will result in the same result, just the internal layout will be different).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Why use 'self.' when its not forced? What is the difference between
Possible Duplicate: When should I use a List vs a LinkedList This question is
Possible Duplicate: When should I use a List vs a LinkedList If I expect
Possible Duplicate: Use same div to toggle different parts of the page Hello I
Possible Duplicate: Does use of final keyword in Java improve the performance? The final
Possible Duplicate: When to use a List over an Array in Java? As the
Possible Duplicate: Use SVN Revision to label build in CCNET I'm working through the
Possible Duplicate: Why use document.write? Considering the negative effects of document.write(), why are most
Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should
Possible Duplicate: When to use “strictfp” keyword in java? What is the use of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.