Royalaid Posted February 24, 2009 Share Posted February 24, 2009 Hey guys, just wondering if i could get some help really quick on an assignment I have for my AP computer science class. It is meant to be a address book but currently sucks to put it lightly. I need a little help finding out why when I add more then on entry to the arraylist it makes all of the contains of the that array the same, that being the last entry. All help is greatly appertained considering that my both my vocational school's programming teacher and my AP Comp Sci teacher couldn't figure it out. link to download is here Opening the main folder in netbeans after you unzip would be the easiest way to help out imo. If you need more information about it please just ask I will be happy to help you help me :) Quote Link to comment Share on other sites More sharing options...
Sparda Posted February 24, 2009 Share Posted February 24, 2009 Run the section of code that populates the arraylist through a step by step debugger. Some thing like that should be easy enough to spot. My guess is it's staying in a particular loop longer than it should. Remember: Where ever you can use a for loop do so, avoid while loops where ever possible. Quote Link to comment Share on other sites More sharing options...
Royalaid Posted February 24, 2009 Author Share Posted February 24, 2009 Thanks for the tip, will try to learn how to use netbeans built in debugger... if i can figure out how to use it Quote Link to comment Share on other sites More sharing options...
Sparda Posted February 25, 2009 Share Posted February 25, 2009 Check out the videos at the bottom of http://debugger.netbeans.org/ Quote Link to comment Share on other sites More sharing options...
Royalaid Posted February 27, 2009 Author Share Posted February 27, 2009 much thanks Sparda the debugger showed me that my arraylist was indeed storing my entries but they were just pointers in memory, so I had to instantiate a new entry variable and that cleared up my problem right quick :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.