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

  • Home
  • SEARCH
  • 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 8281875
In Process

The Archive Base Latest Questions

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

in java, if we store 4 elements in array and array list, is it

  • 0

in java, if we store 4 elements in array and array list, is it same at low level in memory OR does it make any difference in order to store elements ?

  • 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:11:12+00:00Added an answer on June 8, 2026 at 10:11 am

    An array is pretty different from a List, even if the list happens to be an ArrayList and internally uses just an array as well.

    For the array there exists just the array (for this discussion I’ll ignore the memory the elements will occupy). Thus you have one object in the heap, the array itself.

    For the ArrayList, there exists the ArrayList instance and that instance internally has an array. So there are two objects on the heap. Also, while you have exact control over the size of an array you create, the array held by the ArrayList can have any size that is >= number of elements <= Integer.MAX_VALUE.

    Coincidentily, ArrayList uses an elements index directly as array index internally, so the order of elements is the same as in a plain array. But thats an implementation detail, and you normally don’t care how a List organizes its data internally (after all the purpose of Lists is to abstract the messy details away).

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

Sidebar

Related Questions

In Java I want to store elements in ascending order by size. Before insertion
Can any body tell me how can I store Java Date to Mysql datetime...?
Does the Vector class of Java have a limit to the amount of elements
In Java, how can I create an array where each element is a list
Currently I'm using an ArrayList to store a list of elements, whereby I will
I'm trying to make an array of integers in java but it won't work
I have a C program that stores some object in java store using JNI.
I want to use java key store to save keys and certificates. can anybody
I have this algorithm in Java to store passwords in database. I'd like to
I am writing clients in Java that store the data on a database server.

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.