Posting Freak
Posts: 5,744
Threads: 96
Joined: 2009-01
Gender: Male
Sexual Orientation: Straight
Country Flag: New_York
IGN: iCrossBolt
Server: MS2
Job: Ranger
2012-03-10, 06:21 PM
(This post was last modified: 2013-02-03, 07:44 PM by Marksman Bryan.)
so I just realized my APCS teacher will probably use the same assignment and one of my friends just posted this thread on my facebook, soooooooooooo deletin' errything
Posting Freak
Posts: 2,130
Threads: 176
Joined: 2008-08
Post the TOHApp part too. Complete code. With that debug error, you're looking at an off by one error somewhere.
Posting Freak
Posts: 2,130
Threads: 176
Joined: 2008-08
try creating a another program and just useTOHModel code. See if you can even initialize it.
Junior Member
Posts: 21
Threads: 0
Joined: 2009-08
Gender: Male
If I'm not wrong you create an array of Tower objects but don't initialize them. I'm gonna assume that's what causes the issue
Posting Freak
Posts: 2,130
Threads: 176
Joined: 2008-08
Yes that is what I meant,
If you replace Towers with Stack in the code from your code above, so it becomes:
Public Stack[] t = new Stack[3]
then instead of t[0].adddisc
just do t[0].push(new Disc(i));
will it compile?