<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en" xml:base="http://java.fornoobs.info/wp-atom.php">
	<title type="text">java.fornOObs</title>
	<subtitle type="text">Java basics</subtitle>

	<updated>2010-03-30T08:04:08Z</updated>

	<link rel="alternate" type="text/html" href="http://java.fornoobs.info" />
	<id>http://java.fornoobs.info/feed/atom/</id>
	

	<generator uri="http://wordpress.org/" version="3.0.1">WordPress</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/fornoobs/IFZq" /><feedburner:info uri="fornoobs/ifzq" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><link rel="license" type="text/html" href="http://creativecommons.org/licenses/by-nd/2.0/" /><logo>http://creativecommons.org/images/public/somerights20.gif</logo><entry>
		<author>
			<name>Ted H</name>
					</author>
		<title type="html"><![CDATA[How to change JDK in Linux]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/fornoobs/IFZq/~3/wNaubbFkK8g/" />
		<id>http://java.fornoobs.info/?p=511</id>
		<updated>2010-03-30T08:04:08Z</updated>
		<published>2010-03-30T08:03:10Z</published>
		<category scheme="http://java.fornoobs.info" term="Java basics" /><category scheme="http://java.fornoobs.info" term="linux" /><category scheme="http://java.fornoobs.info" term="mint" /><category scheme="http://java.fornoobs.info" term="ubuntu" />		<summary type="html"><![CDATA[Linux Mint or Ubuntu may come with the OpenJDK Java compiler and runtime. If you need to work the Sun version of the Java development kit, you will need to download it. You can do this using the Synaptic app or just open a Terminal window, press ALT-F2, then type gnome-terminal sudo apt-get install sun-java6-jdk [...]]]></summary>
		<content type="html" xml:base="http://java.fornoobs.info/2010/03/how-to-change-jdk-in-linux/">&lt;p&gt;Linux Mint or Ubuntu may come with the OpenJDK Java compiler and runtime. If you need to work the Sun version of the Java development kit, you will need to download it. You can do this using the Synaptic app or just open a Terminal window, press ALT-F2, then type gnome-terminal&lt;/p&gt;
&lt;pre class="command"&gt;sudo apt-get install sun-java6-jdk&lt;/pre&gt;
&lt;p&gt;Ideally, the update should have changed the symlinks and paths for your JDK, but just in case the default is still OpenJDK, you can point the Java compiler to point to the newly downloaded Sun JDK.&lt;/p&gt;
&lt;p&gt;On a terminal window again, just issue the command.&lt;/p&gt;
&lt;p class="command"&gt;$ sudo update-alternatives &amp;#8211;config java&lt;/p&gt;
&lt;p&gt;note: there are 2 dashes before the config.&lt;/p&gt;
&lt;p&gt;It will give you an input dialog like this.&lt;br /&gt;
&lt;img class="size-full wp-image-512 alignleft" title="java-switcher" src="http://java.fornoobs.info/wp-content/uploads/2010/03/java-switcher.png" alt="" width="685" height="195" /&gt;&lt;/p&gt;
&lt;p&gt;Type in the number corresponding to the Sun JDK, then press ENTER.  Your JDK should be pointing to Sun JDK now, you can test it by&lt;/p&gt;
&lt;p class="command"&gt;$ java -version&lt;/p&gt;
&lt;div id="crp_related"&gt;&lt;h3&gt;Related Posts:&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/02/how-to-install-a-barebones-java-development-environment/" rel="bookmark" class="crp_title"&gt;How to install a barebones Java development environment&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/11/hello-world-java/" rel="bookmark" class="crp_title"&gt;Hello World java&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/02/the-for-loop-for-statement/" rel="bookmark" class="crp_title"&gt;The for loop | for statement&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/11/how-to-peek-quickly-inside-the-class-files-using-javap/" rel="bookmark" class="crp_title"&gt;How to peek quickly inside the .class files using javap&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/02/writing-your-first-java-program/" rel="bookmark" class="crp_title"&gt;Writing your first Java program&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Powered by &lt;a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/"&gt;Contextual Related Posts&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/pyVoKFe8gbbMilmd7lyrSK1PQc4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pyVoKFe8gbbMilmd7lyrSK1PQc4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/pyVoKFe8gbbMilmd7lyrSK1PQc4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pyVoKFe8gbbMilmd7lyrSK1PQc4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=wNaubbFkK8g:rKSvscdVGKc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=wNaubbFkK8g:rKSvscdVGKc:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=wNaubbFkK8g:rKSvscdVGKc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?i=wNaubbFkK8g:rKSvscdVGKc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=wNaubbFkK8g:rKSvscdVGKc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=wNaubbFkK8g:rKSvscdVGKc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?i=wNaubbFkK8g:rKSvscdVGKc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=wNaubbFkK8g:rKSvscdVGKc:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=wNaubbFkK8g:rKSvscdVGKc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?i=wNaubbFkK8g:rKSvscdVGKc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/fornoobs/IFZq/~4/wNaubbFkK8g" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://java.fornoobs.info/2010/03/how-to-change-jdk-in-linux/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://java.fornoobs.info/2010/03/how-to-change-jdk-in-linux/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://java.fornoobs.info/2010/03/how-to-change-jdk-in-linux/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Ted H</name>
					</author>
		<title type="html"><![CDATA[How to accept input from keyboard]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/fornoobs/IFZq/~3/7pSUC-3HnAw/" />
		<id>http://java.fornoobs.info/?p=495</id>
		<updated>2009-11-26T14:35:11Z</updated>
		<published>2009-11-26T13:57:15Z</published>
		<category scheme="http://java.fornoobs.info" term="Java basics" /><category scheme="http://java.fornoobs.info" term="I/O" />		<summary type="html"><![CDATA[If you need to write interactive text-based application in Java, you will need a way to accept input from the keyboard; sure you can get it from the command line, but at some point, you will need to prompt the user for an input and store that input somewhere in your code for later processing. [...]]]></summary>
		<content type="html" xml:base="http://java.fornoobs.info/2009/11/accept-input-from-keyboard-using-java-io/">&lt;p&gt;If you need to write interactive text-based application in Java, you will need a way to accept input from the keyboard; sure you can get it from the command line, but at some point, you will need to prompt the user for an input and store that input somewhere in your code for later processing. &lt;/p&gt;
&lt;p&gt;There are lots of ways to do that, this is one of them.  &lt;/p&gt;
&lt;script src="http://gist.github.com/243470.js"&gt;&lt;/script&gt;&lt;noscript&gt;&lt;code class="gist"&gt;&lt;pre&gt;&lt;br /&gt;
import java.io.InputStreamReader;&lt;br /&gt;
import java.io.BufferedReader;&lt;br /&gt;
import java.io.IOException;&lt;/p&gt;
&lt;p&gt;class AcceptInputFromKB {&lt;/p&gt;
&lt;p&gt;   public static void main(String []args) throws IOException {  &lt;/p&gt;
&lt;p&gt;      InputStreamReader isr = new InputStreamReader (System.in);&lt;br /&gt;
      BufferedReader br = new BufferedReader (isr);&lt;/p&gt;
&lt;p&gt;      System.out.print(&amp;#8220;% &amp;#8220;);&lt;br /&gt;
      String temp = br.readLine();&lt;br /&gt;
      System.out.println(temp);&lt;br /&gt;
      System.out.println(&amp;#8220;Length of string = &amp;#8221; + temp.length());&lt;/p&gt;
&lt;p&gt;   }&lt;br /&gt;
}&lt;br /&gt;
&lt;/pre&gt;&lt;/code&gt;&lt;/noscript&gt;
&lt;p&gt;The captured input from the keyboard is already trimmed, there is no need to call temp.trim(); The last System.out.println(&amp;#8220;Length &amp;#8230;&amp;#8221;) is just for show, you can omit that line&amp;#8211;it&amp;#8217;s just there for show-and-tell.&lt;/p&gt;
&lt;p&gt;The second example is a bit more modularized&amp;#8211;in most situations, what you will need is a function in your code that you can call every time you need to prompt the user for input; it would be handy too if this function accepts a String object as parameter which will be displayed as a prompt to the user, and finally, the function should return what the user has typed&amp;#8211;here is the code for that.&lt;/p&gt;
&lt;script src="http://gist.github.com/243477.js"&gt;&lt;/script&gt;&lt;noscript&gt;&lt;code class="gist"&gt;&lt;pre&gt;&lt;/p&gt;
&lt;p&gt;import java.io.InputStreamReader;&lt;br /&gt;
import java.io.BufferedReader;&lt;br /&gt;
import java.io.IOException;&lt;/p&gt;
&lt;p&gt;class Repl {&lt;/p&gt;
&lt;p&gt;   InputStreamReader isr = null;&lt;br /&gt;
   BufferedReader br = null;&lt;/p&gt;
&lt;p&gt;   Repl() {&lt;/p&gt;
&lt;p&gt;      isr = new InputStreamReader(System.in);&lt;br /&gt;
      br = new BufferedReader(isr);&lt;/p&gt;
&lt;p&gt;   }&lt;/p&gt;
&lt;p&gt;   String Prompt(String prompt) {&lt;br /&gt;
      System.out.print(&amp;#8220;% &amp;#8221; + prompt + &amp;#8221; : &amp;#8220;);&lt;br /&gt;
      String retval = null;&lt;br /&gt;
      try {&lt;br /&gt;
         retval =  br.readLine();&lt;br /&gt;
      }&lt;br /&gt;
      catch(IOException ioe) {&lt;br /&gt;
         ioe.printStackTrace();&lt;br /&gt;
      }&lt;br /&gt;
      finally {&lt;br /&gt;
         return retval;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;/p&gt;
&lt;p&gt;   public static void main(String []args)  {  &lt;/p&gt;
&lt;p&gt;      Repl repl = new Repl();&lt;br /&gt;
      String fname = repl.Prompt(&amp;#8220;Enter your first name&amp;#8221;);&lt;br /&gt;
      String lname = repl.Prompt(&amp;#8220;Enter your last name&amp;#8221;);&lt;/p&gt;
&lt;p&gt;      System.out.println(&amp;#8220;Hello &amp;#8221; + fname + &amp;#8221; &amp;#8221; + lname);&lt;/p&gt;
&lt;p&gt;   }&lt;br /&gt;
}&lt;br /&gt;
&lt;/pre&gt;&lt;/code&gt;&lt;/noscript&gt;
&lt;p&gt;This will tie you up if you just need some simple mechanism to display a prompt and get input from the user using text-based interfaces. If you need something more advanced like windowing, positioning the prompts on very specific screen coordinates and coloring the fonts &amp;#8212; that will be a bit more involved to code; you&amp;#8217;re probably better off using some of CURSES related Java libraries like &lt;a href="http://www.nongnu.org/jcurzez/"&gt;JCurzez&lt;/a&gt;, &lt;a href="http://www.pitman.co.za/projects/charva/index.html"&gt;CHARVA&lt;/a&gt; and &lt;a href="http://sourceforge.net/projects/javacurses/"&gt;Java Curses&lt;/a&gt; &amp;#8212; Note though that I haven&amp;#8217;t tried anyone of these 3, but these are the ones I found by quickly Googling &amp;#8216;java curses&amp;#8217;&amp;#8211;that seemed like a good search phrase at the time of writing.&lt;/p&gt;
&lt;div id="crp_related"&gt;&lt;h3&gt;Related Posts:&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/11/starting-database-programming-in-java/" rel="bookmark" class="crp_title"&gt;Starting database programming in Java&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/02/the-rules-for-java-identifiers/" rel="bookmark" class="crp_title"&gt;The rules for Java identifiers&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/11/declaring-an-array-filled-with-objects/" rel="bookmark" class="crp_title"&gt;Declaring an array filled with Objects&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/11/how-to-peek-quickly-inside-the-class-files-using-javap/" rel="bookmark" class="crp_title"&gt;How to peek quickly inside the .class files using javap&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/03/java-array-basics/" rel="bookmark" class="crp_title"&gt;Java array basics&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Powered by &lt;a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/"&gt;Contextual Related Posts&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Qhi-9ZVx-_-k8V3sucda8KGQYds/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Qhi-9ZVx-_-k8V3sucda8KGQYds/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Qhi-9ZVx-_-k8V3sucda8KGQYds/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Qhi-9ZVx-_-k8V3sucda8KGQYds/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=7pSUC-3HnAw:9mAsAhx6lps:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=7pSUC-3HnAw:9mAsAhx6lps:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=7pSUC-3HnAw:9mAsAhx6lps:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?i=7pSUC-3HnAw:9mAsAhx6lps:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=7pSUC-3HnAw:9mAsAhx6lps:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=7pSUC-3HnAw:9mAsAhx6lps:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?i=7pSUC-3HnAw:9mAsAhx6lps:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=7pSUC-3HnAw:9mAsAhx6lps:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=7pSUC-3HnAw:9mAsAhx6lps:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?i=7pSUC-3HnAw:9mAsAhx6lps:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/fornoobs/IFZq/~4/7pSUC-3HnAw" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://java.fornoobs.info/2009/11/accept-input-from-keyboard-using-java-io/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://java.fornoobs.info/2009/11/accept-input-from-keyboard-using-java-io/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://java.fornoobs.info/2009/11/accept-input-from-keyboard-using-java-io/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Ted H</name>
					</author>
		<title type="html"><![CDATA[Multiplication table using 2 for loops in Java]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/fornoobs/IFZq/~3/_uQ2pWUhi48/" />
		<id>http://java.fornoobs.info/?p=475</id>
		<updated>2009-12-10T13:43:51Z</updated>
		<published>2009-11-26T01:44:44Z</published>
		<category scheme="http://java.fornoobs.info" term="Java basics" /><category scheme="http://java.fornoobs.info" term="for loop" />		<summary type="html"><![CDATA[I saw this search term coming up over and over again in my wp-stats, I would guess that this is a school assignment&#8211;for those beginning to get into grips with Java language, this is how to generate the Multiplication table using 2 for loops; you could use another kind of loop, but using &#8216;for&#8217; is [...]]]></summary>
		<content type="html" xml:base="http://java.fornoobs.info/2009/11/multiplication-table-using-2-for-loops-in-java/">&lt;p&gt;I saw this search term coming up over and over again in my wp-stats, I would guess that this is a school assignment&amp;#8211;for those beginning to get into grips with Java language, this is how to generate the Multiplication table using 2 for loops; you could use another kind of loop, but using &amp;#8216;for&amp;#8217; is by far the simplest that I can think of.  &lt;/p&gt;
&lt;p&gt;The size of the multiplication table is determined by the values of rows and columns integer variables, just replace the values according to your need. &lt;/p&gt;
&lt;script src="http://gist.github.com/243165.js"&gt;&lt;/script&gt;&lt;noscript&gt;&lt;code class="gist"&gt;&lt;pre&gt;&lt;/p&gt;
&lt;p&gt;class MultiplicationTable {&lt;/p&gt;
&lt;p&gt;   public static void main(String []args) {&lt;/p&gt;
&lt;p&gt;      int rows=10;&lt;br /&gt;
      int columns=10;&lt;/p&gt;
&lt;p&gt;      for(int i=1;i&lt;=rows;i++) {&lt;br /&gt;
         for(int j=1;j&lt;=columns;j++){&lt;br /&gt;
            System.out.print(i*j + "\t");&lt;br /&gt;
         }&lt;br /&gt;
         System.out.print("\n");&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&lt;/pre&gt;&lt;/code&gt;&lt;/noscript&gt;
&lt;p&gt;"\t" is an escape code for tabs, we'd like each vaulue in our table to have a somewhat uniform spacing, and for this reason too, the System.out.print was used--we don't want to have a new line everytime we print a value, we only want the new line after one complete row (the maximum value of the rows variable, which is the outer for loop) -- which is why the System.out.print("\n") is positioned in the outer for loop. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;compile and run using&lt;/strong&gt;&lt;/p&gt;
&lt;p class="command"&gt;
$ javac MultiplicationTable.java&lt;br /&gt;
$ java MultiplicationTable&lt;/p&gt;
&lt;div id="crp_related"&gt;&lt;h3&gt;Related Posts:&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/02/the-for-loop-for-statement/" rel="bookmark" class="crp_title"&gt;The for loop | for statement&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/11/starting-database-programming-in-java/" rel="bookmark" class="crp_title"&gt;Starting database programming in Java&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/11/increment-and-decrement-operator/" rel="bookmark" class="crp_title"&gt;Increment and decrement operator&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/11/how-to-peek-quickly-inside-the-class-files-using-javap/" rel="bookmark" class="crp_title"&gt;How to peek quickly inside the .class files using javap&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/03/java-array-basics/" rel="bookmark" class="crp_title"&gt;Java array basics&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Powered by &lt;a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/"&gt;Contextual Related Posts&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1pHvdUaabzGoJIPEq6PEGkPAj0Q/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1pHvdUaabzGoJIPEq6PEGkPAj0Q/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1pHvdUaabzGoJIPEq6PEGkPAj0Q/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1pHvdUaabzGoJIPEq6PEGkPAj0Q/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=_uQ2pWUhi48:e1PueiZYNdQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=_uQ2pWUhi48:e1PueiZYNdQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=_uQ2pWUhi48:e1PueiZYNdQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?i=_uQ2pWUhi48:e1PueiZYNdQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=_uQ2pWUhi48:e1PueiZYNdQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=_uQ2pWUhi48:e1PueiZYNdQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?i=_uQ2pWUhi48:e1PueiZYNdQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=_uQ2pWUhi48:e1PueiZYNdQ:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=_uQ2pWUhi48:e1PueiZYNdQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?i=_uQ2pWUhi48:e1PueiZYNdQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/fornoobs/IFZq/~4/_uQ2pWUhi48" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://java.fornoobs.info/2009/11/multiplication-table-using-2-for-loops-in-java/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://java.fornoobs.info/2009/11/multiplication-table-using-2-for-loops-in-java/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://java.fornoobs.info/2009/11/multiplication-table-using-2-for-loops-in-java/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Ted H</name>
					</author>
		<title type="html"><![CDATA[Starting database programming in Java]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/fornoobs/IFZq/~3/wRbxs7idW10/" />
		<id>http://java.fornoobs.info/?p=463</id>
		<updated>2009-11-26T05:35:49Z</updated>
		<published>2009-11-25T13:07:42Z</published>
		<category scheme="http://java.fornoobs.info" term="Java basics" /><category scheme="http://java.fornoobs.info" term="database programming" /><category scheme="http://java.fornoobs.info" term="jdbc" /><category scheme="http://java.fornoobs.info" term="sqlite" />		<summary type="html"><![CDATA[Database programming is probably one of the most common tasks that you will encounter in your programming career&#8211;in fact, during job interviews, it is an expectation that you know how to deal with the most common databases in use&#8211;like for example, MySQL, Oracle, MS SQL Server and many others. Java database programming can get hairy [...]]]></summary>
		<content type="html" xml:base="http://java.fornoobs.info/2009/11/starting-database-programming-in-java/">&lt;p&gt;Database programming is probably one of the most common tasks that you will encounter in your programming career&amp;#8211;in fact, during job interviews, it is an expectation that you know how to deal with the most common databases in use&amp;#8211;like for example, MySQL, Oracle, MS SQL Server and many others. &lt;/p&gt;
&lt;p&gt;Java database programming can get hairy sometimes when you&amp;#8217;re doing really complicated tasks&amp;#8211;but understanding the basics is a straightforward process. Most java database programs do the following.&lt;/p&gt;
&lt;p class="notes"&gt;
&lt;ol&gt;
&lt;li&gt;Load the driver for the database you are using &amp;#8212; most database makers provide a java database driver, mostly these are jar files where the java libraries needed to talk to the database are packaged.&lt;/li&gt;
&lt;li&gt;Get a Connection object &amp;#8211; This is the initial handshake with the database, if the database requires that you enter a username and password, this is also the step where you give the database your security credentials. The Connection object is important because you will need it to produce the other objects you will use later in order to send SQL commands to the database. The Connection object is also responsible if you would like to influence the behavior of autocommit&amp;#8211;whether you would like to have more control over the rollback and commit activities of the database&lt;/li&gt;
&lt;li&gt;Fetching records, Inserting records, modifying records and deleting records &amp;#8212; You can use either the Statement object or the PreparedStatement object to perform these tasks.  &lt;/li&gt;
&lt;li&gt;Closing all connections &lt;/li&gt;
&lt;/ol&gt;
&lt;/p &gt;
&lt;p&gt;After you have successfully created the database, you can now try out the code. So Launch your favorite editor and code away.&lt;/p&gt;
&lt;h2&gt;Sample java database code&lt;/h2&gt;
&lt;p&gt;Below is a &lt;a href="http://en.wikipedia.org/wiki/Boilerplate_(text)"&gt;boiler-plate code&lt;/a&gt; for a Java program which accesses a database. It uses sqlite3. &lt;/p&gt;
&lt;p&gt;You need to prepare the database first and create sample.db using sqlite, lest the code will fail. Here&amp;#8217;s how to quickly prepare our sample database.&lt;/p&gt;
&lt;p class="command"&gt;
$ sqlite3 sample.db&lt;br /&gt;
SQLite version 3.6.12&lt;br /&gt;
Enter &amp;#8220;.help&amp;#8221; for instructions&lt;br /&gt;
Enter SQL statements terminated with a &amp;#8220;;&amp;#8221;&lt;br /&gt;
sqlite&gt; CREATE TABLE user(username varchar(50), email varchar(200), password varchar(20));&lt;br /&gt;
sqlite&gt; insert into user values(&amp;#8216;ted&amp;#8217;, &amp;#8216;ted@fornoobs.info&amp;#8217;,'I wont tell you&amp;#8217;);&lt;br /&gt;
sqlite&gt; select * from user;&lt;br /&gt;
ted|ted@fornoobs.info|I wont tell you&lt;br /&gt;
sqlite&gt; .quit&lt;br /&gt;
$
&lt;/p&gt;
&lt;script src="http://gist.github.com/242696.js"&gt;&lt;/script&gt;&lt;noscript&gt;&lt;code class="gist"&gt;&lt;pre&gt;&lt;br /&gt;
import java.sql.DriverManager;&lt;br /&gt;
import java.sql.Connection;&lt;br /&gt;
import java.sql.Statement;&lt;br /&gt;
import java.sql.ResultSet;&lt;br /&gt;
import java.sql.SQLException;&lt;/p&gt;
&lt;p&gt;class DBSample {&lt;/p&gt;
&lt;p&gt;   public static void main(String []args){&lt;/p&gt;
&lt;p&gt;      Connection cn = null;&lt;br /&gt;
      Statement st = null;&lt;br /&gt;
      ResultSet rs = null;&lt;/p&gt;
&lt;p&gt;      try {&lt;/p&gt;
&lt;p&gt;         Class.forName(&amp;#8220;org.sqlite.JDBC&amp;#8221;);&lt;br /&gt;
         cn = DriverManager.getConnection(&amp;#8220;jdbc:sqlite:sample.db&amp;#8221;);&lt;br /&gt;
         st = cn.createStatement();&lt;br /&gt;
         rs = st.executeQuery(&amp;#8220;SELECT * FROM user;&amp;#8221;);&lt;/p&gt;
&lt;p&gt;         while(rs.next()) {&lt;br /&gt;
            System.out.print(rs.getString(1));&lt;br /&gt;
            System.out.print(rs.getString(2));&lt;br /&gt;
            System.out.println(rs.getString(3));&lt;br /&gt;
         }&lt;/p&gt;
&lt;p&gt;      }&lt;br /&gt;
      catch(ClassNotFoundException ce) {&lt;br /&gt;
         ce.printStackTrace();&lt;br /&gt;
      }&lt;br /&gt;
      catch(SQLException sqle) {&lt;br /&gt;
         sqle.printStackTrace();&lt;br /&gt;
      }&lt;br /&gt;
      finally {&lt;br /&gt;
         try {&lt;br /&gt;
            rs.close();&lt;br /&gt;
            st.close();&lt;br /&gt;
            cn.close();&lt;br /&gt;
         }&lt;br /&gt;
         catch(SQLException sqle) {&lt;br /&gt;
            sqle.printStackTrace();&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&lt;/pre&gt;&lt;/code&gt;&lt;/noscript&gt;
&lt;p&gt;&lt;strong&gt;Class.forName(&amp;#8220;org.sqlite.JDBC&amp;#8221;)&lt;/strong&gt; &amp;#8211; The reason we are calling this is so that we can load the methods of sqlite database functions, specifically the JDBC class found in org/sqlite package (folder). The JDBC class contains the necessary CLI (Command Level Interface) for the sqlite database, we don&amp;#8217;t have to call them natively because org.sqlite.JDBC class is already acting as a wrapper for those calls. You could actually load the sqlite Java driver as well by just calling &amp;#8216;new org.sqlite.JDBC();&amp;#8217;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;DriverManager.getConnection()&lt;/strong&gt; &amp;#8211; the getConnection() method returns Connection interface (a Connection type). The Connection object is the one responsible for, well, the connection to the database. It is also via the Connection object that you can adjust how database writes are performed, whether it commits automatically or otherwise.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;jdbc:sqlite:sample.db&lt;/strong&gt; &amp;#8211; The parameter for the getConnection() method is the database URL, the database URL is composed of 3 parts and each part is separated by a colon (:). Most java database URLs start with jdbc, the second part will vary depending on which database you are using&amp;#8211;you will need to look at the documentation of each jdbc driver for the URL, it will be different if you will use say, MySQL or MS SQL or Oracle.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;#8220;SELECT * FROM user;&amp;#8221;&lt;/strong&gt; &amp;#8211; This is a standard SQL command which will select all records from the user database defined in sample.db, it&amp;#8217;s a good idea to test out the command in the command line of sqlite first before writing it here, especially if the SQL command becomes a bit more complicated than simple selects. You will write the SQL statements as parameter to the executeQuery() method of the Statement object. The .executeQuery() returns a ResultSet object which we can use to process the returned CURSOR&amp;#8211;a CURSOR means CURrent Set Of Records, it&amp;#8217;s a database term, but for now just imagine that they are pretty much like Excel worksheets, they are composed of rows and columns which contains the user information. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;rs.next()&lt;/strong&gt;  &amp;#8211; The next() method returns actually does 2 things, first, it moves the location of our database pointer (if you can imagine it) so that it fetches the next row, then it returns true if there are more records to process; when you have reached the last record or there are no more records to process, the .next() method will return false&amp;#8211;this is the reason I placed it inside a while loop, the loop will be processed only as long as there are records to process. When there are no more records to read, our while loop will exit. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;getString()&lt;/strong&gt; &amp;#8211; The getString() method extracts the the contents of the current record. The numbered parameter inside the getString() indicates which column you would like to fetch. The column count for ResultSet objects actually starts at 1&amp;#8211;not zero, you need to remember this because it can be confusing sometimes that array counting starts at zero, that is true for arrays, not true for ResultSet objects&amp;#8211;always start counting at 1. You can actually use the field name if you like, so instead of writing getString(1), you can write getString(&amp;#8220;username&amp;#8221;). One more important thing to mention, I only used getString() because the data type of what I&amp;#8217;m trying to read from the database is String (varchar actually, which is a String type), if you were reading a numeric value like an integer, you should use getInt() instead&amp;#8211;you need to read the &lt;a href="http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSet.html"&gt;java.sql.ResultSet documentation&lt;/a&gt; to have a feel of what kinds of data types you can use.&lt;/p&gt;
&lt;p&gt;The example is a bit verbose, but it&amp;#8217;s representative of most database programming codes that we do Java. &lt;/p&gt;
&lt;h2&gt;Notes on exception handling blocks&lt;/h2&gt;
&lt;p&gt;The methods forName(), getConnection(), createStatement(), executeQuery() and next() throws ClassNotFoundException and SQLException(s) respectively. This is a reason why they are inside a try-catch-finally block, Java won&amp;#8217;t allow you to compile if Exceptions are not handled properly. &lt;/p&gt;
&lt;div id="crp_related"&gt;&lt;h3&gt;Related Posts:&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/02/the-while-loop-while-statement/" rel="bookmark" class="crp_title"&gt;The while loop | while statement&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/11/multiplication-table-using-2-for-loops-in-java/" rel="bookmark" class="crp_title"&gt;Multiplication table using 2 for loops in Java&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/11/accept-input-from-keyboard-using-java-io/" rel="bookmark" class="crp_title"&gt;How to accept input from keyboard&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/11/how-to-peek-quickly-inside-the-class-files-using-javap/" rel="bookmark" class="crp_title"&gt;How to peek quickly inside the .class files using javap&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/11/notes-on-apache-ant/" rel="bookmark" class="crp_title"&gt;Notes on Apache Ant&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Powered by &lt;a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/"&gt;Contextual Related Posts&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1_4BvLInTWf0s3tpO29h6D58e14/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1_4BvLInTWf0s3tpO29h6D58e14/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1_4BvLInTWf0s3tpO29h6D58e14/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1_4BvLInTWf0s3tpO29h6D58e14/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=wRbxs7idW10:uuJxQnhN0Ws:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=wRbxs7idW10:uuJxQnhN0Ws:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=wRbxs7idW10:uuJxQnhN0Ws:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?i=wRbxs7idW10:uuJxQnhN0Ws:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=wRbxs7idW10:uuJxQnhN0Ws:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=wRbxs7idW10:uuJxQnhN0Ws:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?i=wRbxs7idW10:uuJxQnhN0Ws:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=wRbxs7idW10:uuJxQnhN0Ws:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=wRbxs7idW10:uuJxQnhN0Ws:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?i=wRbxs7idW10:uuJxQnhN0Ws:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/fornoobs/IFZq/~4/wRbxs7idW10" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://java.fornoobs.info/2009/11/starting-database-programming-in-java/#comments" thr:count="2" />
		<link rel="replies" type="application/atom+xml" href="http://java.fornoobs.info/2009/11/starting-database-programming-in-java/feed/atom/" thr:count="2" />
		<thr:total>2</thr:total>
	<feedburner:origLink>http://java.fornoobs.info/2009/11/starting-database-programming-in-java/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Ted H</name>
					</author>
		<title type="html"><![CDATA[How to peek quickly inside the .class files using javap]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/fornoobs/IFZq/~3/LwDKv1Eh3vA/" />
		<id>http://java.fornoobs.info/?p=459</id>
		<updated>2009-11-26T14:42:20Z</updated>
		<published>2009-11-24T12:51:12Z</published>
		<category scheme="http://java.fornoobs.info" term="Java basics" /><category scheme="http://java.fornoobs.info" term="tips" />		<summary type="html"><![CDATA[If you need just need to quickly see the name of the methods of a specific Java class or you want to take a look at a disassembled code, you can use javap. If your JDK is properly installed and you have setup your PATH and CLASSPATH properly, then you can already use javap&#8211;it&#8217;s executable [...]]]></summary>
		<content type="html" xml:base="http://java.fornoobs.info/2009/11/how-to-peek-quickly-inside-the-class-files-using-javap/">&lt;p&gt;If you need just need to quickly see the name of the methods of a specific Java class or you want to take a look at a disassembled code, you can use &lt;strong&gt;javap&lt;/strong&gt;. If your JDK is properly installed and you have setup your PATH and CLASSPATH properly, then you can already use javap&amp;#8211;it&amp;#8217;s executable file is located in /Path/To/YourJDK/Installation/bin. &lt;/p&gt;
&lt;h2&gt;Basic use of javap&lt;/h2&gt;
&lt;p class="command"&gt;
$ javap java.lang.String
&lt;/p&gt;
&lt;p&gt;This will print out (to the standard output, your monitor) all the method signatures of java.lang.String, pretty much what you will find in the JDK documentation, only without the brief explanations&amp;#8211;although not as complete as the JDK documentation, it&amp;#8217;s at a quick way to just look at at the method signatures of specific classes. This is a handy technique to have while coding because you can quickly access the exact definitions for method signatures. &lt;/p&gt;
&lt;p&gt;If you want to learn more about javap, all you&amp;#8217;ve got to do is to type javap -help in the command line so that you can see all of it&amp;#8217;s options. I&amp;#8217;m including it here for your reference.&lt;/p&gt;
&lt;pre class="notes"&gt;
$ javap -help
Usage: javap
&lt;options&gt; &lt;classes&gt;...

where options include:
   -c                        Disassemble the code
   -classpath
&lt;pathlist&gt;     Specify where to find user class files
   -extdirs &lt;dirs&gt;           Override location of installed extensions
   -help                     Print this usage message
   -J&lt;flag&gt;                  Pass &lt;flag&gt; directly to the runtime system
   -l                        Print line number and local variable tables
   -public                   Show only public classes and members
   -protected                Show protected/public classes and members
   -package                  Show package/protected/public classes
                             and members (default)
   -private                  Show all classes and members
   -s                        Print internal type signatures
   -bootclasspath
&lt;pathlist&gt; Override location of class files loaded
                             by the bootstrap class loader
   -verbose                  Print stack size, number of locals and args for methods
                             If verifying, print reasons for failure
&lt;/pre&gt;
&lt;div id="crp_related"&gt;&lt;h3&gt;Related Posts:&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/02/how-to-install-a-barebones-java-development-environment/" rel="bookmark" class="crp_title"&gt;How to install a barebones Java development environment&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/02/final-classes/" rel="bookmark" class="crp_title"&gt;Final classes&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/02/the-rules-for-java-identifiers/" rel="bookmark" class="crp_title"&gt;The rules for Java identifiers&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/03/java-interfaces/" rel="bookmark" class="crp_title"&gt;Java interfaces&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.fornoobs.info/2009/02/accessibility/" rel="bookmark" class="crp_title"&gt;Accessibility&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Powered by &lt;a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/"&gt;Contextual Related Posts&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/rZYESqd7AQOfJ0yDiqhPMS_nbH8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rZYESqd7AQOfJ0yDiqhPMS_nbH8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/rZYESqd7AQOfJ0yDiqhPMS_nbH8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rZYESqd7AQOfJ0yDiqhPMS_nbH8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=LwDKv1Eh3vA:4BpX2C7DLoA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=LwDKv1Eh3vA:4BpX2C7DLoA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=LwDKv1Eh3vA:4BpX2C7DLoA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?i=LwDKv1Eh3vA:4BpX2C7DLoA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=LwDKv1Eh3vA:4BpX2C7DLoA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=LwDKv1Eh3vA:4BpX2C7DLoA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?i=LwDKv1Eh3vA:4BpX2C7DLoA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=LwDKv1Eh3vA:4BpX2C7DLoA:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/fornoobs/IFZq?a=LwDKv1Eh3vA:4BpX2C7DLoA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/fornoobs/IFZq?i=LwDKv1Eh3vA:4BpX2C7DLoA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/fornoobs/IFZq/~4/LwDKv1Eh3vA" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://java.fornoobs.info/2009/11/how-to-peek-quickly-inside-the-class-files-using-javap/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://java.fornoobs.info/2009/11/how-to-peek-quickly-inside-the-class-files-using-javap/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://java.fornoobs.info/2009/11/how-to-peek-quickly-inside-the-class-files-using-javap/</feedburner:origLink></entry>
	</feed>
