Results 1 to 3 of 3
Thread: J2ME Dynamic arrays
- 08-11-2011, 12:20 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 8
- Rep Power
- 0
J2ME Dynamic arrays
Hi
I need to use an array of objects in my J2Me application that will need to both grow and shrink depending on the number of objects contained within. I have so far re-created the entire array each time a new object is to be added or removed with either one more or one less element - this works but is horrible in terms of eficiency and (i suspect) memory usage.
Is there another way? (I'm stuck using JDK1.5)
Cheers for any advice given!.gif)
FR
- 08-11-2011, 01:08 PM #2
That's about the same way the Java ME core classes (as also Collection classes like ArrayList) do it.
For improving the efficiency, go through the source of (Java SE) java.util.ArrayList -- it doesn't recreate the array on every add/remove.
db
- 08-11-2011, 02:35 PM #3
Member
- Join Date
- Feb 2011
- Posts
- 8
- Rep Power
- 0
Similar Threads
-
Arrays.sort... why sorting all arrays in class?
By innspiron in forum New To JavaReplies: 6Last Post: 03-23-2010, 01:40 AM -
2d dynamic arrays
By seeder in forum Advanced JavaReplies: 1Last Post: 03-15-2010, 10:03 AM -
dynamic two dimensional arrays?
By dinosoep in forum New To JavaReplies: 4Last Post: 12-05-2009, 06:12 PM -
Sending J2ME application by blue tooth (by J2ME application). Very URGENT!!!
By maruffaiz in forum CLDC and MIDPReplies: 0Last Post: 04-22-2009, 01:30 PM -
How to create Dynamic application using J2ME?
By sharmaj2me in forum CLDC and MIDPReplies: 1Last Post: 01-31-2009, 03:19 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks