[b][red]This message was edited by epimetheus at 2006-9-30 7:12:0[/red][/b][hr]
So in class we have to write a silly program utilizing a linked list of general objects containing data. In this program, we have to emulate a donut shop and boxes of doughnuts. The user enters several types of doughnuts (no limit other than at least 1) in the command line. Each string is sent to the Doughnut constructor which sets the string as type and initializes the doughnuts as boxes with 12 doughnuts in each box.
When I send a string, such as l.addFront(args[i]); it works just fine, but when I do the same command with l.addFront(new Doughnut(args[i])); it says it puts something into the list, but when I print it, all I get is null. (l.size()) returns the number of items I entered, say 4 for my test runs, but l.toString() returns null.
I put my code up on my webpage so not to take up lots of space here: It is three different files, one in each table. http://adhochaven.net/files/lab3.html
(edited- forgot to include link)
I have other things I have to write in, my driver program is just a test program, the other one involves decrementing the doughnuts in each box, and removing the box from the list when it is zero. But for now, I can't even get it to load up and print my lists, can anybody help me?
-epimetheus (who is apparently too ignorant to get a simple thing like this to work)