Hello Everyone. I've found this website to be incredible useful in getting through the assignment. I'm currently a bit on a problem with ArrayLists (URLyBird List getRecord() ). Everytime I add a field[] array to the ArrayList, it overwrites all previously added field[] arrays.
Any idea on how to get around this?
Sun Certified Java Programmer<br />Sun Certified Web Component Developer<br />Sun Certifed System Administrator<br />Sun Certified Network Administrator<br />BEA Weblogic Certified Developer
Philippe Maquet
Bartender
Joined: Jun 02, 2003
Posts: 1872
posted
0
Hi Anthony, Welcome to this forum. What you seem to overwrite is the String rec[] in this loop :
Cheers, Phil.
Anthony Erickson
Greenhorn
Joined: Dec 18, 2003
Posts: 6
posted
0
Thanks, Phillipe. I'll have to give that a shot. Looks like lack of Much appreciated
Anthony Erickson
Greenhorn
Joined: Dec 18, 2003
Posts: 6
posted
0
Hmm....Just tested the code out. I'm still stumped. The first get() correctly pulls out the key, value pair. The second get(), which is outside of the loops, shows that ALL values are set to the last added value. Any ideas?
Philippe Maquet
Bartender
Joined: Jun 02, 2003
Posts: 1872
posted
0
Hi Anthony,
The first get() correctly pulls out the key, value pair. The second get(), which is outside of the loops, shows that ALL values are set to the last added value.
Normal I think : I don't see that you create a *new* fields array at each step in the for loop on rowCount. Regards, Phil.
Anthony Erickson
Greenhorn
Joined: Dec 18, 2003
Posts: 6
posted
0
Thanks Philippe! It works now. Looks like a Java 101 Error (:eek on my part.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.