<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/1.5.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: BeerSong.java</title>
	<link>http://www.esnider.net/2008/03/09/beer-song/</link>
	<description>version 2.0</description>
	<pubDate>Thu, 04 Dec 2008 18:48:19 +0000</pubDate>
	<generator>http://wordpress.org/?v=1.5.2</generator>

	<item>
		<title>by: Nek Strebor</title>
		<link>http://www.esnider.net/2008/03/09/beer-song/#comment-19042</link>
		<pubDate>Mon, 07 Apr 2008 16:24:47 +0000</pubDate>
		<guid>http://www.esnider.net/2008/03/09/beer-song/#comment-19042</guid>
					<description>
/**
 * Simple program that prints out the words
 * to the 99 Bottles of Beer on the Wall
 * song.
 *
 * Based on the BeerSong example in the
 * _Head_First_Java_ book with corrections.
 */
public class BeerSong {
	public static void main(String[] args) {
		int beerNum = 99;
		String word = &quot;bottles&quot;;

		while (beerNum &amp;#62; 0) {
		    System.out.println(beerNum + &quot; &quot; + word + &quot; of beer on the wall.&quot;);
		    System.out.println(beerNum + &quot; &quot; + word + &quot; of beer.&quot;);

		    if (beerNum != 1) {
			System.out.println(&quot;Take one down.&quot;);
		    }
		    else {
			System.out.println(&quot;Take it down.&quot;);            	            	
		    }            

		    System.out.println(&quot;Pass it around.&quot;);
		    beerNum--;

		    switch (beerNum) {
			case 0:
				System.out.println(&quot;No more bottles of beer on the wall.&quot;);
				break;
			case 1:
				word = &quot;bottle&quot;;
				// yes, there is no break;
			default:
				System.out.println(beerNum + &quot; &quot; + word + &quot; of beer on the wall.\n&quot;);				 
				break;
		    } 
		}		
	}
}
</description>
		<content:encoded><![CDATA[	<p>/**<br />
 * Simple program that prints out the words<br />
 * to the 99 Bottles of Beer on the Wall<br />
 * song.<br />
 *<br />
 * Based on the BeerSong example in the<br />
 * _Head_First_Java_ book with corrections.<br />
 */<br />
public class BeerSong {<br />
	public static void main(String[] args) {<br />
		int beerNum = 99;<br />
		String word = &#8220;bottles&#8221;;</p>
	<p>		while (beerNum &gt; 0) {<br />
		    System.out.println(beerNum + &#8221; &#8221; + word + &#8221; of beer on the wall.&#8221;);<br />
		    System.out.println(beerNum + &#8221; &#8221; + word + &#8221; of beer.&#8221;);</p>
	<p>		    if (beerNum != 1) {<br />
			System.out.println(&#8221;Take one down.&#8221;);<br />
		    }<br />
		    else {<br />
			System.out.println(&#8221;Take it down.&#8221;);<br />
		    }            </p>
	<p>		    System.out.println(&#8221;Pass it around.&#8221;);<br />
		    beerNum&#8211;;</p>
	<p>		    switch (beerNum) {<br />
			case 0:<br />
				System.out.println(&#8221;No more bottles of beer on the wall.&#8221;);<br />
				break;<br />
			case 1:<br />
				word = &#8220;bottle&#8221;;<br />
				// yes, there is no break;<br />
			default:<br />
				System.out.println(beerNum + &#8221; &#8221; + word + &#8221; of beer on the wall.\n&#8221;);<br />
				break;<br />
		    }<br />
		}<br />
	}<br />
}
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
