Beer Song, can only get it start at 59 and then it counts down
Joined: Sep 28, 2010
The beer song in Head First book seems to be working but it always starts counting down from 59. I've tried
doing a "int beerNum = 99;" and it always just starts at 59. I've tried less than 59 and it responds properly by counting down from that number. I've got 60 stuck in the code below and it still always starts at 59 for the count down. Thanks
Welcome to JavaRanch! As Christophe hints -- ItDoesntWorkIsUseless. We have no way helping you work through your code if we can't see it! :)
W. Joe Smith
Joined: Feb 10, 2009
Your command window is deleting them because it only holds so many lines. If you take out all of your system.out.println()'s and just print the number you will see it counts down from 99, just not showing anything past 59.
Also in Java classes always start with a capital letter, so your class should be TestBeerSong, not testBeerSong.
When I die, I want people to look at me and say "Yeah, he might have been crazy, but that was one zarkin frood that knew where his towel was."