<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>20papercups :: Michael Marner&#039;s Website &#187; Java Video Tutorials</title>
	<atom:link href="http://www.20papercups.net/category/java-vtm-tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.20papercups.net</link>
	<description>The (awesome) website of Michael Marner</description>
	<lastBuildDate>Mon, 24 May 2010 13:29:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Java Tutorial 09 &#8211; OpenGL and Java</title>
		<link>http://www.20papercups.net/java-vtm-tutorials/java-vtm09-opengl-and-java/</link>
		<comments>http://www.20papercups.net/java-vtm-tutorials/java-vtm09-opengl-and-java/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 10:51:13 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Java Video Tutorials]]></category>
		<category><![CDATA[3dbuzz]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jogl]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.20papercups.net/?p=100</guid>
		<description><![CDATA[This video looks at how we can use the OpenGL graphics library in our Java programs. This video was an entry in a competition on 3dbuzz.com. As such, it doesn&#8217;t flow on from the previous videos, just consider it a bonus. Note that this video is 1024&#215;768, so hit the full screen button to get [...]]]></description>
			<content:encoded><![CDATA[<p>This video looks at how we can use the OpenGL graphics library in our Java programs. This video was an entry in a competition on <a href="http://www.3dbuzz.com" target="_blank">3dbuzz.com</a>. As such, it doesn&#8217;t flow on from the previous videos, just consider it a bonus.<span id="more-100"></span></p>
<p style="text-align: center;"><img src="http://www.20papercups.net/wp-content/plugins/flash-video-player/default_video_player.gif" /></p>
<p style="text-align: left;">Note that this video is 1024&#215;768, so hit the full screen button to get more readable detail.</p>
<p style="text-align: left;"><strong>Notes:</strong></p>
<p style="text-align: left;">This video is the property of 3DBuzz Inc. Jason and Zak have kindly given me permission to host it on this website. Because it is not owned by me, I would appreciate it if you did not distribute this video. Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.20papercups.net/java-vtm-tutorials/java-vtm09-opengl-and-java/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Java Tutorial 08 &#8211; Intro To Eclipse</title>
		<link>http://www.20papercups.net/java-vtm-tutorials/java-vtm08-intro-to-eclipse/</link>
		<comments>http://www.20papercups.net/java-vtm-tutorials/java-vtm08-intro-to-eclipse/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 01:54:54 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Java Video Tutorials]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.20papercups.net/?p=98</guid>
		<description><![CDATA[This video gives an overview of the Eclipse IDE. Eclipse is a feature packed Java development environment that is also free and open source. In this video we see how we create projects in eclipse and run our programs. Note that this video is 1024&#215;768, so hit the full screen button to get more readable [...]]]></description>
			<content:encoded><![CDATA[<p>This video gives an overview of the Eclipse IDE. Eclipse is a feature packed Java development environment that is also free and open source. In this video we see how we create projects in eclipse and run our programs.<span id="more-98"></span></p>
<p style="text-align: center;"><img src="http://www.20papercups.net/wp-content/plugins/flash-video-player/default_video_player.gif" /></p>
<p style="text-align: left;">Note that this video is 1024&#215;768, so hit the full screen button to get more readable detail.</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-9376349336558898";
google_ad_slot = "0815367707";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p style="text-align: center;">
<p style="text-align: left;"><strong>Notes:</strong></p>
<p style="text-align: left;">You can get Eclipse from http://www.eclipse.org. It is available for pretty much all platforms. If you&#8217;re on Linux it is probably in your distribution&#8217;s repository.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.20papercups.net/java-vtm-tutorials/java-vtm08-intro-to-eclipse/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Java Tutorial 07 &#8211; Arrays</title>
		<link>http://www.20papercups.net/java-vtm-tutorials/java-vtm07-arrays/</link>
		<comments>http://www.20papercups.net/java-vtm-tutorials/java-vtm07-arrays/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 01:50:57 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Java Video Tutorials]]></category>

		<guid isPermaLink="false">http://www.20papercups.net/?p=89</guid>
		<description><![CDATA[Our first look at a data structure &#8211; arrays. First we talk about what arrays are, then explain how we can use them with loops to do something useful. We also have a look at the String[] argument to the main method. Note that this video is 800&#215;600, so hit the full screen button to [...]]]></description>
			<content:encoded><![CDATA[<p>Our first look at a data structure &#8211; arrays. First we talk about what arrays are, then explain how we can use them with loops to do something useful. We also have a look at the String[] argument to the main method.<span id="more-89"></span></p>
<p style="text-align: center;"><img src="http://www.20papercups.net/wp-content/plugins/flash-video-player/default_video_player.gif" /></p>
<p style="text-align: left;">Note that this video is 800&#215;600, so hit the full screen button to get more readable detail.</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-9376349336558898";
google_ad_slot = "0815367707";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p style="text-align: center;">
<p style="text-align: center;">
]]></content:encoded>
			<wfw:commentRss>http://www.20papercups.net/java-vtm-tutorials/java-vtm07-arrays/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Java Tutorial 06 &#8211; Strings &amp; Objects</title>
		<link>http://www.20papercups.net/java-vtm-tutorials/java-vtm06-strings-objects/</link>
		<comments>http://www.20papercups.net/java-vtm-tutorials/java-vtm06-strings-objects/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 01:43:32 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Java Video Tutorials]]></category>

		<guid isPermaLink="false">http://www.20papercups.net/?p=87</guid>
		<description><![CDATA[Our first look at objects in Java. There is a lot to cover, so in this video we focus on strings, and how we use methods to manipulate them. Note that this video is 800&#215;600, so hit the full screen button to get more readable detail.]]></description>
			<content:encoded><![CDATA[<p>Our first look at objects in Java. There is a lot to cover, so in this video we focus on strings, and how we use methods to manipulate them.<span id="more-87"></span></p>
<p style="text-align: center;"><img src="http://www.20papercups.net/wp-content/plugins/flash-video-player/default_video_player.gif" /></p>
<p style="text-align: left;">Note that this video is 800&#215;600, so hit the full screen button to get more readable detail.</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-9376349336558898";
google_ad_slot = "0815367707";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p style="text-align: center;">
<p style="text-align: center;">
]]></content:encoded>
			<wfw:commentRss>http://www.20papercups.net/java-vtm-tutorials/java-vtm06-strings-objects/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Java Tutorial 05 &#8211; Loops</title>
		<link>http://www.20papercups.net/java-vtm-tutorials/java-vtm05-loops/</link>
		<comments>http://www.20papercups.net/java-vtm-tutorials/java-vtm05-loops/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 01:41:09 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Java Video Tutorials]]></category>

		<guid isPermaLink="false">http://www.20papercups.net/?p=85</guid>
		<description><![CDATA[This video introduces looping. For, While and Do While loops are covered. Finally, a simple way to do repetitive tasks. Note that this video is 800&#215;600, so hit the full screen button to get more readable detail.]]></description>
			<content:encoded><![CDATA[<p>This video introduces looping. For, While and Do While loops are covered. Finally, a simple way to do repetitive tasks.<span id="more-85"></span></p>
<p style="text-align: center;"><img src="http://www.20papercups.net/wp-content/plugins/flash-video-player/default_video_player.gif" /></p>
<p style="text-align: left;">Note that this video is 800&#215;600, so hit the full screen button to get more readable detail.</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-9376349336558898";
google_ad_slot = "0815367707";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p style="text-align: center;">
<p style="text-align: center;">
]]></content:encoded>
			<wfw:commentRss>http://www.20papercups.net/java-vtm-tutorials/java-vtm05-loops/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Java Tutorial 04 &#8211; Control Structures</title>
		<link>http://www.20papercups.net/java-vtm-tutorials/java-vtm04-control-structures/</link>
		<comments>http://www.20papercups.net/java-vtm-tutorials/java-vtm04-control-structures/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 01:38:33 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Java Video Tutorials]]></category>

		<guid isPermaLink="false">http://www.20papercups.net/?p=78</guid>
		<description><![CDATA[This video looks at control structures. Specifically, if/else blocks and switch blocks. By the end of it you will be able to write programs that make decisions on what to do. UPDATE:I just realised I forgot to include Keyboard.java, which is required for this video. It is now uploaded. Note that this video is 800&#215;600, [...]]]></description>
			<content:encoded><![CDATA[<p>This video looks at control structures. Specifically, if/else blocks and switch blocks. By the end of it you will be able to write programs that make decisions on what to do.<span id="more-78"></span></p>
<p><strong>UPDATE:</strong>I just realised I forgot to include <a href="http://www.20papercups.net/wp-content/uploads/2008/12/Keyboard.java">Keyboard.java</a>, which is required for this video. It is now uploaded.</p>
<p style="text-align: center;"><img src="http://www.20papercups.net/wp-content/plugins/flash-video-player/default_video_player.gif" /></p>
<p style="text-align: left;">Note that this video is 800&#215;600, so hit the full screen button to get more readable detail.</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-9376349336558898";
google_ad_slot = "0815367707";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p style="text-align: center;">
<p style="text-align: center;">
]]></content:encoded>
			<wfw:commentRss>http://www.20papercups.net/java-vtm-tutorials/java-vtm04-control-structures/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Java Tutorial 03 &#8211; Arithmetic Operators</title>
		<link>http://www.20papercups.net/java-vtm-tutorials/java-vtm03-arithmetic-operators/</link>
		<comments>http://www.20papercups.net/java-vtm-tutorials/java-vtm03-arithmetic-operators/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 01:38:22 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Java Video Tutorials]]></category>

		<guid isPermaLink="false">http://www.20papercups.net/?p=83</guid>
		<description><![CDATA[In this video we look at arithmetic operators, enabling us to do some calculations in our programs. Note that this video is 800&#215;600, so hit the full screen button to get more readable detail.]]></description>
			<content:encoded><![CDATA[<p>In this video we look at arithmetic operators, enabling us to do some calculations in our programs.<span id="more-83"></span></p>
<p style="text-align: center;"><img src="http://www.20papercups.net/wp-content/plugins/flash-video-player/default_video_player.gif" /></p>
<p style="text-align: left;">Note that this video is 800&#215;600, so hit the full screen button to get more readable detail.</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-9376349336558898";
google_ad_slot = "0815367707";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p style="text-align: center;">
<p style="text-align: center;">
]]></content:encoded>
			<wfw:commentRss>http://www.20papercups.net/java-vtm-tutorials/java-vtm03-arithmetic-operators/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Java Tutorial 02 &#8211; Datatypes &amp; Variables</title>
		<link>http://www.20papercups.net/java-vtm-tutorials/java-vtm02-datatypes-variables/</link>
		<comments>http://www.20papercups.net/java-vtm-tutorials/java-vtm02-datatypes-variables/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 01:38:09 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Java Video Tutorials]]></category>

		<guid isPermaLink="false">http://www.20papercups.net/?p=73</guid>
		<description><![CDATA[This video introduces you to the primitive datatypes in available in Java. We also look at variables to show how we can store data. Note that this video is 800&#215;600, so hit the full screen button to get more readable detail.]]></description>
			<content:encoded><![CDATA[<p>This video introduces you to the primitive datatypes in available in Java. We also look at variables to show how we can store data.<span id="more-73"></span></p>
<p style="text-align: center;"><img src="http://www.20papercups.net/wp-content/plugins/flash-video-player/default_video_player.gif" /></p>
<p style="text-align: left;">Note that this video is 800&#215;600, so hit the full screen button to get more readable detail.</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-9376349336558898";
google_ad_slot = "0815367707";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p style="text-align: center;">
<p style="text-align: center;">
]]></content:encoded>
			<wfw:commentRss>http://www.20papercups.net/java-vtm-tutorials/java-vtm02-datatypes-variables/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Java Tutorial 01 &#8211; Intro To Java</title>
		<link>http://www.20papercups.net/java-vtm-tutorials/java01-intro/</link>
		<comments>http://www.20papercups.net/java-vtm-tutorials/java01-intro/#comments</comments>
		<pubDate>Sun, 09 Dec 2007 10:03:56 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Java Video Tutorials]]></category>

		<guid isPermaLink="false">http://marner.servebeer.com/wordpress/?p=50</guid>
		<description><![CDATA[This video walks through the process of installing and setting up the Java development kit. It then introduces you to your first program, the ubiquitous Hello World. Note that this video is 800&#215;600, so hit the full screen button to get more readable detail.]]></description>
			<content:encoded><![CDATA[<p>This video walks through the process of installing and setting up the Java development kit. It then introduces you to your first program, the ubiquitous Hello World.<span id="more-50"></span></p>
<p style="text-align: center;"><img src="http://www.20papercups.net/wp-content/plugins/flash-video-player/default_video_player.gif" /></p>
<p style="text-align: left;">Note that this video is 800&#215;600, so hit the full screen button to get more readable detail.</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-9376349336558898";
google_ad_slot = "0815367707";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p style="text-align: center;">
<p style="text-align: center;">
]]></content:encoded>
			<wfw:commentRss>http://www.20papercups.net/java-vtm-tutorials/java01-intro/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
		<item>
		<title>Java Tutorials: Series 1 Errata</title>
		<link>http://www.20papercups.net/java-vtm-tutorials/java-vtm-series-1-errata/</link>
		<comments>http://www.20papercups.net/java-vtm-tutorials/java-vtm-series-1-errata/#comments</comments>
		<pubDate>Thu, 05 Apr 2007 06:33:49 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Java Video Tutorials]]></category>

		<guid isPermaLink="false">http://marner.servebeer.com/wordpress/?p=46</guid>
		<description><![CDATA[Well, the Java VTM series 1 has been incredibly well recieved. Thankyou everyone for your support and comments about my videos. However, I&#8217;ve got a couple of things to fix regarding the videos, so here are some series 1 corrections. So whats wrong with the videos? Nothing actually, but times change. Java has evolved over [...]]]></description>
			<content:encoded><![CDATA[<p>Well, the Java VTM series 1 has been incredibly well recieved. Thankyou everyone for your support and comments about my videos. However, I&#8217;ve got a couple of things to fix regarding the videos, so here are some series 1 corrections.<span id="more-46"></span></p>
<p>So whats wrong with the videos? Nothing actually, but times change. Java has evolved over the years and the API gets bigger with every release. See, when I started learning Java, version 1.4 had just been released. In this version, like the version before that there was no simple way to extract data from the keyboard. Enter the Keyboard class. This is a java file that I wrote for the Java VTM. It has simple methods for getting data from the keyboard, so that you don&#8217;t have to do it yourself.</p>
<p>However, times change. With the release of Java 5 extracting data from the keyboard has never been easier. What this means for you is that you can pretty much throw my Keyboard class away. It is now obsolete. There is now a standard Java class called <strong>Scanner</strong>. Have a look in the Java API. There are all these methods like nextInt, nextDouble, nextLine etc. What Scanner does is provide a simple way to get data from the keyboard (any InputStream actually), so we don&#8217;t have to do the hard work ourselves.</p>
<p>Lets look at at the following code from Video 4 in the VTM. This is how the video explained how to get data from the keyboard.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">int</span> testInt<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">double</span> testDouble<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">char</span> testChar<span style="color: #339933;">;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">testInt <span style="color: #339933;">=</span> Keyboard.<span style="color: #006633;">readInt</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
testDouble <span style="color: #339933;">=</span> Keyboard.<span style="color: #006633;">readDouble</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
testChar <span style="color: #339933;">=</span>  Keyboard.<span style="color: #006633;">readChar</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now lets change the code so we use Scanner instead. The first thing we need to do is create an instance of Scanner. There are a couple of constructors available, but the one we are interested in takes an InputStream as its parameter. If we want to get data from the keyboard, we need to pass in System.in as the parameter.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">Scanner keyboard <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Scanner<span style="color: #009900;">&#40;</span><span style="color: #003399;">System</span>.<span style="color: #006633;">in</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//create a scanner object</span></pre></div></div>

<p>Now that we have the scanner ready to go, we can use all of its methods to access data that I did using my Keyboard class. The code below shows how we can get numbers from the keyboard.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">testInt <span style="color: #339933;">=</span> keyboard.<span style="color: #006633;">nextInt</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
testDouble <span style="color: #339933;">=</span> keyboard.<span style="color: #006633;">nextDouble</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>So what about characters? Well, there isn&#8217;t a dedicated method for getting a character from Scanner. Same with Strings. There is a method called nextLine() in Scanner, but it doesn&#8217;t really do what you expect. If there is a line waiting to be read on the InputStream (such as in files), it will read the line. However, if there isn&#8217;t a line waiting to be read you will get an exception! Not fun. So, for doing character and String reading a BufferedReader is the way to go.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">BufferedReader</span> reader <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">BufferedReader</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">InputStreamReader</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">System</span>.<span style="color: #006633;">in</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>With BufferedReader you can read in lines or characters from an input stream. So to get a character and string you would do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Please enter a char&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//readline returns a String, so we get the character</span>
testChar <span style="color: #339933;">=</span> reader.<span style="color: #006633;">readLine</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">charAt</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Please enter a String&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
testString <span style="color: #339933;">=</span> reader.<span style="color: #006633;">readLine</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Note that the code above should be contained within a try block, as an IOException may be thrown.</p>
<p>So with that, throw away Keyboard.java because you don&#8217;t need it all. The ever expanding Java API now has all of Keyboard&#8217;s functionality and a whole heap more. Finally there is an easy way to get data from the keyboard, without having to write your own classes. <a href="http://marner.servebeer.com/wordpress/wp-content/uploads/2008/12/keyboardtest.zip">Here</a> is the full Java file from VTM 4, using Scanner and BufferedReader instead of the Keyboard class.</p>
<p>Later<br />
Michael</p>
]]></content:encoded>
			<wfw:commentRss>http://www.20papercups.net/java-vtm-tutorials/java-vtm-series-1-errata/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
