I am having a problem in one of my programs and i cant seem to get ir right. I have an array, that holds an object. I go through this array with a for loop checking if any of the slots in the array are null, if a spot is null return true, if the entire array is full, return false. Then it prints everything in the array.
The problem is, this is looped, so when it does it again, its like it was never done the first time and the entire array was set back to null and the values were never there!
Thank you for your help [ March 06, 2005: Message edited by: Sean Magee ]
It's difficult to understand what is happening. Could you post the relevant code for us to have a look at? Remember to use the 'CODE' button before you copy and paste.
Joined: Aug 23, 2004
I have the code on my laptop, but i try my best to replicate here.
I am having problems with two of my classes, but i think i have to throw the code out for three so you can understand my problem
Ok, so thats the code where the touble lies I think. I have a couple of other classes that I am not showing, like the talk class which mainly deal with the userinput and alos haas a boolean vairable that is assigned by the addCust method, but of course, it never returns false. The talk class also askes which bus the user would like to ride, and how many people the user would like to book, indicated by the passnum and depart integers being passed through the toBooker method in the mainstreet class. However when this JOptionPane.showMessageDialog(null,""+fullorder); talk again = new talk(); again.askToPurchase(); executes, it askes the user again which shuttle, which departure, and if you pick the same one as before,
the customer array, the order array, and the shuttle array
all have seem to be reset back to null, and did not store the original values that were set by the user.
Can you see what i am doing wrong here? [ March 06, 2005: Message edited by: Sean Magee ]
Joined: Aug 23, 2004
Is this enought code to identify the problem??
If it isn;t please let me know so I can make additions accordingly.
Joined: Feb 23, 2005
Hi. Sorry, I forgot about this yesterday. The code you have supplied is insufficient to understand the problem (and some of it doesn't seem valid).
If you post the rest, and point out where in the code you are having a problem, someone will help.