473,382 Members | 1,809 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Is the ArrayList order guaranteed

Hi,

I use the ArrayList to store objects. Is the sequence of
the objects guaranteed or is it possible that the
framework reordes the object sequence in some memory
handling task? Know its maybe an odd question but I
remember from STL that some collections didn't guarantee
this.

Thanks.
Jesper.

Nov 15 '05 #1
1 4882
Jesper,

For your purposes, you can assume that if you place an item at index
one, then it will stay at index one until it is changed by you or code you
call. The framework will not change the index. The memory where objects
are located might be rearranged, but it will not affect the index that is
stored at in the ArrayList.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jesper Denmark" <an*******@discussions.microsoft.com> wrote in message
news:0a****************************@phx.gbl...
Hi,

I use the ArrayList to store objects. Is the sequence of
the objects guaranteed or is it possible that the
framework reordes the object sequence in some memory
handling task? Know its maybe an odd question but I
remember from STL that some collections didn't guarantee
this.

Thanks.
Jesper.

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Alex Vorobiev | last post by:
hi there, i am using sql server 7. below is the stored procedure that is giving me grief. its purpose it two-fold, depending on how it is called: either to return a pageset (based on page...
4
by: Bob Weiner | last post by:
What I want to be able to do is create an indexer that can index into an ArrayList filled with objects of my own type. I have the following class structure: ...
4
by: John Slate | last post by:
Not sure exactly how to ask this, but I have a situation where I need to 'shuffle' the order of a list of test questions, so that the questions appear in a random order each time the test is taken....
2
by: John Grandy | last post by:
What are good rules of thumb to use when deciding between a NameValueCollection, an ArrayList, or a Hashtable ?
7
by: Adam | last post by:
Hi all, In my VB.NET code below, I try to change the user name in my arraylist from Ted to Bob, but instead it adds a new user to the arraylist named Bob. Can anyone explain why this happens and...
19
by: Derek Martin | last post by:
Hi there, I have been playing with sorting my arraylist and having some troubles. Maybe just going about it wrong. My arraylist contains objects and one of the members of the object is 'name.' I...
9
by: Paul Nations | last post by:
I've got arraylists of simple classes bound to controls. I need to search through those arraylists to set the correct SelectedItem in the control. The code looks like: Public Class...
4
by: blisspikle | last post by:
The following sub form1_load reads in a text file that will say something like the text below. I think that the problem is that every time I add a class V_Sensor into the arraylist it puts it in...
6
by: fniles | last post by:
I am using VB.NET 2003 and a socket control to receive and sending data to clients. As I receive data in 1 thread, I put it into an arraylist, and then I remove the data from arraylist and send it...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.