Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tower's of Hanoi using Stacks - Java
#10
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?
Reply


Messages In This Thread
Tower's of Hanoi using Stacks - Java - by XTOTHEL - 2012-03-10, 07:02 PM
Tower's of Hanoi using Stacks - Java - by XTOTHEL - 2012-03-10, 07:58 PM
Tower's of Hanoi using Stacks - Java - by XTOTHEL - 2012-03-10, 08:02 PM
Tower's of Hanoi using Stacks - Java - by XTOTHEL - 2012-03-10, 08:25 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)