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 8281549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:04:28+00:00 2026-06-08T10:04:28+00:00

My intuition says arrays are faster than arraylist because arraylists are implemented using arrays

  • 0

My intuition says arrays are faster than arraylist because arraylists are implemented using arrays that resize as it fills up/loses elements.

I just wanted to confirm if this is true or not, implying there’s never a reason to use an arraylist if you know the number of elements you want to hold.

  • 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-06-08T10:04:29+00:00Added an answer on June 8, 2026 at 10:04 am

    Any performance difference will be negligible, especially if you initialize your arraylist with an initialCapacity. Write your code in whatever way makes it the most readable and maintainable, and try not to optimize stuff like this unless you’ve determined through testing that you are getting a significant performance hit from it.

    Potential reasons to use ArrayList:

    • useful methods (contains, etc.)
    • implements Iterable, Collection, and List, and can therefore be used in a lot of API calls that are interface-based.
    • even though you currently “know” that your collection’s size can never change, life throws unexpected requirements at us. Why lock yourself into a pattern when there’s no discernible advantage to be gained?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My intuition says that ontology engines like Triplestore or Seseme are going to be
I've been hunting for a long time for this, but despite my intuition that
Everybody says that immutable objects are thread safe, but why is this? Take the
The following article http://docs.oracle.com/javaee/1.4/tutorial/doc/JAXPXSLT3.html says that XPATH considers the following to be nodes: Root
My intuition was Lorem ipsum\footnote{long footnote that spans a whole bunch of lines. }
Typeclassopedia says: A similar argument also shows that any Functor instance satisfying the first
Here it says that SimpleCursorAdapter 's API level 1 constructor is deprecated and the
My intuition is that it's a good idea to encapsulate blocks of code in
I am having problem developing intuition about the probabilistic interpretation of logistic regression. Specifically,
My intention is to read every elements in the 2nd column into a buffer[]

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.