<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4873923668672596462</id><updated>2012-01-02T10:47:10.981-08:00</updated><category term='Local inner classes'/><category term='static methods cant be overridden'/><category term='Overriding'/><category term='Runtime exceptions'/><category term='Cohesion'/><category term='Interview Questions'/><category term='Overriding and Overloading'/><category term='JMS Sample Code'/><category term='Concurrent Access Problems'/><category term='JCAPS'/><category term='eDesigner in Debug Mode'/><category term='Using a Variable or Array Element That Is Uninitialized and Unassigned'/><category term='JMSSecurityException'/><category term='HashSet'/><category term='Communicating with Objects by Waiting and Notifying'/><category term='Handling Exceptions'/><category term='Ways to create a thread'/><category term='SQL Scripts using Forward Engineering'/><category term='Synchronize arraylist'/><category term='What is XML-RPC?'/><category term='Local variable'/><category term='Declarations and Access Control'/><category term='JMeter'/><category term='Extensibility'/><category term='Agile Timeboxing'/><category term='final variables'/><category term='Overridden methods'/><category term='StringBuffer'/><category term='Yield'/><category term='Array'/><category term='Polymorphism'/><category term='Eclipse'/><category term='Sleep'/><category term='Key Attributes of Common Collection Classes'/><category term='Iterator'/><category term='Catch'/><category term='Blocked state'/><category term='ERROR_CODEGEN_GENERIC_CODELET_GENERAL in JCAPS 5.1.0'/><category term='differences between JSF and Struts'/><category term='Asynchronous Message'/><category term='Methods of the javax.servlet.Servlet interface'/><category term='Event Handling in Web Service'/><category term='Declaration'/><category term='Finally'/><category term='final method'/><category term='Selenium'/><category term='Tortoise SVN'/><category term='Arrays'/><category term='Declaration Rules'/><category term='SSL Certificates'/><category term='Threads'/><category term='Implementing an Interface'/><category term='Downcasting'/><category term='what is struts config xml'/><category term='SOA'/><category term='static variable'/><category term='Default access'/><category term='Automatic variables'/><category term='SVN plugin for eclipse'/><category term='What is WSDL?'/><category term='Constructor'/><category term='Exception'/><category term='Singleton Pattern'/><category term='Statics'/><category term='Life cycle methods of a Servlet'/><category term='HashMap class'/><category term='drug rehab center'/><category term='JCAPS installation process'/><category term='MySQL Dump Command'/><category term='Implicit Objects in JSP'/><category term='Inheritance'/><category term='Set Interface'/><category term='Superclass'/><category term='How to use Comparable Interface'/><category term='Collection framework'/><category term='struts-config.xml'/><category term='MySQL Start and Stop'/><category term='JCAPS eDesigner'/><category term='Iterator Usage'/><category term='Basic jar tool commands'/><category term='Coupling'/><category term='TreeSet'/><category term='Overriding hashCode() and equals()'/><category term='IntelliJ Idea Settings for cache'/><category term='Overloading'/><category term='alltreatment program'/><category term='Eclipse Code Formatting'/><category term='Synchronous vs Asynchronous'/><category term='List Interface'/><category term='Selenium Configuration'/><category term='Adding SSL Certificate in JCAPS 5.1.3'/><category term='Tips for Effective Software Reuse'/><category term='WEB-INF'/><category term='Update jars in eDesigner'/><category term='Directory structure of a web application'/><category term='JCAPS QUestions'/><category term='Encapsulation'/><category term='Utilities'/><category term='notify() method'/><category term='Transitioning Between Thread States'/><category term='General Technical Questions'/><category term='Comparable Interface'/><category term='HttpClient vs HttpURLConnection'/><category term='Map Iterator'/><category term='Synchronized Threads'/><category term='JMS Messaging'/><category term='Instantiating'/><category term='Try'/><category term='Abstract class'/><category term='XML Utility'/><category term='Scope'/><category term='Collections'/><category term='Utility Classes: Collections and Arrays'/><category term='Constructors and Instantiation'/><category term='Messaging Bus'/><category term='Access different file formats in Java'/><category term='Collection Interface'/><category term='FindBugs Configuration'/><category term='SortedSet'/><category term='do-while loop'/><category term='Abstract method'/><category term='Overloaded methods'/><category term='Heap'/><category term='The markup in the document preceeding the root element must be well-formed'/><category term='MySQL'/><category term='What is UDDI?'/><category term='Upcasting'/><category term='and StringBuilder'/><category term='Collection'/><category term='HAS-A'/><category term='Coupling and Cohesion'/><category term='jcaps command line build process'/><category term='Steps to add certificate to keystore'/><category term='Switch Statement'/><category term='When would the constructor in the abstract class be called ?'/><category term='static methods'/><category term='FindBugs'/><category term='HttpURLConnection'/><category term='Exceptions'/><category term='SVN Configuration'/><category term='Class members'/><category term='Visibility'/><category term='Serialization'/><category term='Starting Threads'/><category term='Synchronized methods'/><category term='Web Service Faults'/><category term='instanceof operator'/><category term='Inner classes'/><category term='Reference Variable Casting'/><category term='Initialization Blocks'/><category term='Estimation Techniques'/><category term='IS-A'/><category term='MySQL Workbench'/><category term='Transient Keyword'/><category term='Defining'/><category term='Interface'/><category term='Instance variable'/><category term='What is the Web service protocol stack?'/><category term='Exception handling'/><category term='Passing Variables into Methods'/><category term='Running JMeter in Non GUI mode'/><category term='What is Service-Oriented Architecture?'/><category term='final class'/><category term='struts config'/><category term='Using String'/><category term='notify()'/><category term='Stack and Heap'/><category term='The markup in the document following the root element must be well-formed'/><category term='JUnit'/><category term='Finalizer'/><category term='Compensation Handlers'/><category term='Synchronous Message'/><category term='Java Virtual Machine (JVM)'/><category term='Return Types'/><category term='What is a Web Service'/><category term='java.lang package'/><category term='Lean Six Sigma Green Belt Certification Workshop Pune'/><category term='Thread'/><category term='Anonymous inner classes'/><category term='SortedMap'/><category term='Test Driven Developement'/><category term='and Join'/><category term='Sorting and Searching Arrays and Lists'/><category term='Client Handling Techniques'/><category term='Morpheus Archetypes Pune'/><category term='JCAPS Logging'/><category term='EJB VS Hibernate'/><category term='Casting'/><category term='Web Service'/><category term='Thread States'/><category term='Ohio treatment centers'/><category term='Remove duplicate emements'/><category term='Object Creation'/><category term='Selenium Tutorial'/><category term='SVN Setup'/><category term='Identifiers'/><category term='Dealing with Clients'/><category term='Continue Statement'/><category term='Can a abstract class have a constructor ?'/><category term='static nested classes'/><title type='text'>JAVA</title><subtitle type='html'>Java, JCAPS 513/6.0, JBI, Hibernate, Sping, JSF, JSP, Servlets, Debugging, Exception Handling, Resolving technical issues</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default?start-index=101&amp;max-results=100'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>155</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-3293680089953381235</id><published>2011-04-26T08:52:00.000-07:00</published><updated>2011-04-26T09:43:34.096-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Morpheus Archetypes Pune'/><category scheme='http://www.blogger.com/atom/ns#' term='Lean Six Sigma Green Belt Certification Workshop Pune'/><title type='text'>Lean Six Sigma Green Belt Certification Workshop Pune</title><content type='html'>&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;4 Day Lean Six Sigma Green Belt Certification Workshops&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Pune&lt;/div&gt;&lt;div&gt;Workshop Dates:&lt;/div&gt;&lt;div&gt;Workshop 1 - 14th, 15th, 21st and 22nd May 2011&lt;/div&gt;&lt;div&gt;Workshop 2 – 04th, 05th, 11th and 12th June 2011&lt;/div&gt;&lt;div&gt;Note: The workshops have been scheduled on weekends specifically to accommodate working professionals&lt;/div&gt;&lt;div&gt;Batch Size: maximum of 10 participants per workshop&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Last date for registration:&lt;/div&gt;&lt;div&gt;Workshop 1 – 5th May 2011&lt;/div&gt;&lt;div&gt;Workshop 2 – 23rd May 2011&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Workshop Timings:&lt;/div&gt;&lt;div&gt;9:30 am to 6:00pm&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Workshop Venue:&lt;/div&gt;&lt;div&gt;Premium Business Hotel in Pune&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For registrations:&lt;/div&gt;&lt;div&gt;Email us at contactus@morpheusarchetypes.com&lt;/div&gt;&lt;div&gt;OR&lt;/div&gt;&lt;div&gt;Call us on 020-41322100 / 9860361610 / 9049392089&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Nilesh Chavan&lt;/div&gt;&lt;div&gt;Head - Process Consulting Group&lt;/div&gt;&lt;div&gt;Morpheus Archetypes Management Solutions Pvt. Ltd.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-3293680089953381235?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/3293680089953381235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=3293680089953381235' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/3293680089953381235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/3293680089953381235'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2011/04/day-lean-six-sigma-green-belt.html' title='Lean Six Sigma Green Belt Certification Workshop Pune'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-7025793310667051835</id><published>2011-04-14T23:23:00.000-07:00</published><updated>2011-04-14T23:24:48.641-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drug rehab center'/><category scheme='http://www.blogger.com/atom/ns#' term='alltreatment program'/><category scheme='http://www.blogger.com/atom/ns#' term='Ohio treatment centers'/><title type='text'>Ohio Treatment Centers Are ready to co-opearte with you</title><content type='html'>&lt;div class="entry"&gt;&lt;p&gt;Today, there is a huge craze of the drug rehab  program for the better recovery from the problem of drug addiction. Drug  addiction is the most dangerous problem which is mostly occurred among  the young generation of the modern era in an eminent manner. This  problem is mostly seen on most of the people of the modern era  currently.&lt;/p&gt; &lt;p&gt;Ohio treatment centers are the centers which are mainly established  for the purpose of treating the problems like drug addiction in an  efficient manner. The &lt;strong&gt;Ohio treatment centers&lt;/strong&gt; are actually the online directory of the centers for the drug addiction removal problems. &lt;/p&gt; &lt;p&gt;The &lt;a href="http://www.ohiotreatmentcenters.org/"&gt;Ohio treatment centers&lt;/a&gt; generally make use of the several sorts of  useful drug rehab programs which plays a vital role in the treatment of  the problems mentioned above.  The entire abuse treatment center  generally possesses a great specialization in their drug addiction  removal by the use of genuine drug rehab programs of the centre.&lt;/p&gt; &lt;p&gt;One can easily fill the online registration form and avail for the  requisite drug addiction treatment after a proper visit on the sites  offering the same. So, it is better for the user to have an easy visit  on the site and opt for the genuine program for treating the drug  addiction problems in an efficient manner.&lt;/p&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-7025793310667051835?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/7025793310667051835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=7025793310667051835' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7025793310667051835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7025793310667051835'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2011/04/ohio-treatment-centers-are-ready-to-co.html' title='Ohio Treatment Centers Are ready to co-opearte with you'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-3519587390780739920</id><published>2009-09-14T00:13:00.001-07:00</published><updated>2009-09-14T21:30:54.409-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Access different file formats in Java'/><title type='text'>Access different file formats in Java</title><content type='html'>&lt;div class="gmail_quote"&gt;              &lt;div link="blue" vlink="purple" lang="EN-US"&gt;  &lt;div&gt;  &lt;p&gt;&lt;b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri; font-weight: bold;"&gt;How do I access the XYZ file format in java? &lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;Specifications for many file formats can be found at &lt;a href="http://www.wotsit.org/" target="_blank"&gt;Wotsit&lt;/a&gt;. A large database of file types can be found at &lt;a href="http://www.file-extensions.org/" target="_blank"&gt;www.file-extensions.org&lt;/a&gt;. Marco Schmidt maintains several very useful &lt;a href="http://schmidt.devlib.org/java/index.html" target="_blank"&gt;lists of links&lt;/a&gt; about processing a multitude of document formats. &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;An interesting article about Microsoft&amp;#39;s binary file formats, especially DOC and XLS, is &lt;a href="http://www.joelonsoftware.com/items/2008/02/19.html" target="_blank"&gt;Why are the Microsoft Office file formats so complicated? (And some workarounds)&lt;/a&gt; It also mentions some alternatives to dealing with those formats directly. &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri; font-weight: bold;"&gt;Access&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;ul type="disc"&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;JDBC/ODBC bridge - JDBC driver for ODBC      databases, comes as part of the JDK; on Linux, you&amp;#39;ll have to get ODBC up      and running first: &lt;a href="http://www.unixodbc.org/" target="_blank"&gt;http://www.unixodbc.org/&lt;/a&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://jackcess.sourceforge.net/" target="_blank"&gt;Jackcess&lt;/a&gt;      - library to read and write MDB files&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://www.hxtt.com/access.html" target="_blank"&gt;HXTT      Access&lt;/a&gt; - commercial pure Java JDBC driver for MS Access&lt;/span&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri; font-weight: bold;"&gt;CGM&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;ul type="disc"&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://www.bdaum.de/howto.htm" target="_blank"&gt;cgmva&lt;/a&gt;      - an applet to display CGM files; comes with source code&lt;/span&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri; font-weight: bold;"&gt;CHM&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;ul type="disc"&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="https://sourceforge.net/projects/jchm/" target="_blank"&gt;JChm&lt;/a&gt; - library to read      CHM files&lt;/span&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri; font-weight: bold;"&gt;Excel&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;ul type="disc"&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://ostermiller.org/utils/CSV.html" target="_blank"&gt;Ostermiller Utils&lt;/a&gt;, &lt;a href="http://csvparser.sourceforge.net/" target="_blank"&gt;CSVObjects&lt;/a&gt;, &lt;a href="http://sourceforge.net/projects/csvbeans/" target="_blank"&gt;CSVBeans&lt;/a&gt; and &lt;a href="http://opencsv.sourceforge.net/" target="_blank"&gt;opencsv&lt;/a&gt; - libraries to read and      write CSV files. CSV is not as easy to read and write as it first looks -      once all the special cases are considered, one might as well use a      library. &lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://jakarta.apache.org/poi/" target="_blank"&gt;POI&lt;/a&gt; - library to read and write      XLS files&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://jexcelapi.sourceforge.net/" target="_blank"&gt;JExcelAPI&lt;/a&gt; - library to read      and write XLS files&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;Opinions on jExcelApi vs.      POI: &lt;a href="http://mail-archives.apache.org/mod_mbox/jakarta-poi-user/200505.mbox/%3C0IFZ00IV2QVKJ6@mta3.srv.hcvlny.cv.net%3E" target="_blank"&gt;here&lt;/a&gt;      and &lt;a href="http://forum.java.sun.com/thread.jspa?threadID=513505&amp;amp;messageID=2511809" target="_blank"&gt;here&lt;/a&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://jXLS.sourceforge.net/" target="_blank"&gt;jXLS&lt;/a&gt; - library for writing XLS      files based on templates&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://java2excel.sourceforge.net/" target="_blank"&gt;Java2Excel&lt;/a&gt; - library for      creating Excel files based on Collections&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;It is possible to use &lt;a href="http://www.javaworld.com/javaworld/javaqa/2001-06/04-qa-0629-excel.html" target="_blank"&gt;JDBC      to read Excel files&lt;/a&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://www.obba.info/" target="_blank"&gt;Obba&lt;/a&gt; works with Excel spreadsheets on      Windows&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="https://sourceforge.net/projects/openxls/" target="_blank"&gt;OpenXLS&lt;/a&gt; -      &amp;quot;OpenXLS is the open source version of ExtenXLS - a Java spreadsheet      SDK that allows you to read, modify and create Java Excel spreadsheets      from your Java applications.&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri; font-weight: bold;"&gt;HDF (Hierarchical Data Format)&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;ul type="disc"&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://hdf.ncsa.uiuc.edu/hdf-java-html/" target="_blank"&gt;Java products by the HDF      Group&lt;/a&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri; font-weight: bold;"&gt;Image files&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;ul type="disc"&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://rsb.info.nih.gov/ij/" target="_blank"&gt;ImageJ&lt;/a&gt; - Java image processing      application and library that has plugins for lots of image file formats&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://java.sun.com/products/jimi/" target="_blank"&gt;JIMI&lt;/a&gt; - library to read and      write BMP, CUR, GIF, ICO, JPEG, PICT, PNG, PSD, Sun Raster, TGA, TIFF, XBM      and XPM. There&amp;#39;s a &lt;a href="http://rsb.info.nih.gov/ij/plugins/jimi.html" target="_blank"&gt;plugin&lt;/a&gt;      for using JIMI with ImageJ, which also includes a couple of JIMI patches.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="https://jai-imageio.dev.java.net/binary-builds.html" target="_blank"&gt;GIF write, and      TIFF, RAW, PNM and JPEG2000 read/write support for ImageIO&lt;/a&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri; font-weight: bold;"&gt;Matlab&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;ul type="disc"&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=10759&amp;amp;objectType=File" target="_blank"&gt;JMatIO      - Matlab&amp;#39;s MAT-file I/O in JAVA&lt;/a&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri; font-weight: bold;"&gt;OpenDocument (ODF)&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;ul type="disc"&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;basic Java code for reading      ODF files &lt;a href="http://books.evc-cit.info/odf_utils/" target="_blank"&gt;is here&lt;/a&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://odftoolkit.org/projects/odfdom/pages/Home" target="_blank"&gt;ODFDOM&lt;/a&gt; is a      Java library for accessing ODF files.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://www.jopendocument.org/" target="_blank"&gt;jDocument.org&lt;/a&gt; has an open-source      library for accessing all Open Document file types.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://www.obba.info/" target="_blank"&gt;Obba&lt;/a&gt; works with OpenOffice&lt;a href="http://faq.javaranch.com/edit?OpenOffice" target="_blank"&gt;?&lt;/a&gt; spreadsheets&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri; font-weight: bold;"&gt;Office Open XML&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;ul type="disc"&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;These are the new XML-based Microsoft Office      formats.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://www.openxml4j.org/" target="_blank"&gt;OpenXML4J&lt;/a&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://dev.plutext.org/trac/docx4j" target="_blank"&gt;docx4j&lt;/a&gt;      - create and edit docx documents using a JAXB content model matching the      WordML schema &lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://poi.apache.org/" target="_blank"&gt;Apache POI&lt;/a&gt;      3.5 (which is in beta, but is usable already) implements these formats.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri; font-weight: bold;"&gt;OpenOffice Java API&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;ul type="disc"&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;OpenOffice can read a number      of file formats, and makes them accessible through its API. A starting      point might be &lt;a href="http://weblogs.java.net/blog/tchangu/archive/2005/12/open_office_jav_1.html" target="_blank"&gt;this      article&lt;/a&gt;, &lt;a href="http://www.javaworld.com/cgi-bin/mailto/x_java.cgi?pagetosend=/export/home/httpd/javaworld/javaworld/jw-05-2008/jw-05-spreadsheets.html&amp;amp;pagename=/javaworld/jw-05-2008/jw-05-spreadsheets.html&amp;amp;pageurl=http://www.javaworld.com/javaworld/jw-05-2008/jw-05-spreadsheets.html&amp;amp;site=jw_core" target="_blank"&gt;this      article&lt;/a&gt; and of course the &lt;a href="http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/OpenOffice.org_Developers_Guide" target="_blank"&gt;OO      developer site&lt;/a&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;Some introductory information      about the OO file format can be found &lt;a href="http://www-128.ibm.com/developerworks/xml/library/x-think15/" target="_blank"&gt;here&lt;/a&gt;      and &lt;a href="http://www.xml.com/lpt/a/2001/02/07/openoffice.html" target="_blank"&gt;here&lt;/a&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="https://oooview.dev.java.net/" target="_blank"&gt;oooview&lt;/a&gt; is an OO Viewer written      in Java.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://www.artofsolving.com/opensource/jodconverter" target="_blank"&gt;JODConverter&lt;/a&gt;      is a Java library that uses the OO Java API to perform document      conversions between any formats supported by OO&lt;/span&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri; font-weight: bold;"&gt;Outlook MSG&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;ul type="disc"&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;The Jakarta POI project      developed some code that can read the texual contents of Outlook&amp;#39;s MSG      files. &lt;a href="http://jakarta.apache.org/poi/hsmf/" target="_blank"&gt;This page&lt;/a&gt; talks      about that. &lt;/span&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri; font-weight: bold;"&gt;PDF&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;ul type="disc"&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;PDF is a hard to read format.      The best one can do is try to extract the text contained in a PDF file.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://www.lowagie.com/iText/" target="_blank"&gt;iText&lt;/a&gt; - library to create PDFs &lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://xmlgraphics.apache.org/fop/" target="_blank"&gt;FOP&lt;/a&gt; - libray to create PDFs      (and other formats) from XML by using XSL-FO transformations&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="https://xhtmlrenderer.dev.java.net/" target="_blank"&gt;FlyingSaucer&lt;/a&gt; - library to      convert CSS-styled XHTML to PDF&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://www.pdfbox.org/" target="_blank"&gt;PDFBox&lt;/a&gt; - library to create PDFs; can      also extract text&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://sourceforge.net/projects/clown/" target="_blank"&gt;PDF Clown&lt;/a&gt; -      general-purpose library to read/create/modify PDF files. It features a      rich multi-layered object model that allows access even to each single      content stream instruction. &lt;a href="http://en.wikipedia.org/wiki/PDF_Clown" target="_blank"&gt;wikipedia article&lt;/a&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://www.jpedal.org/" target="_blank"&gt;JPedal&lt;/a&gt; - library to extract text from      PDFs&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://www.snowtide.com/" target="_blank"&gt;PDFTextStream&lt;/a&gt; - commercial library to      extract text from PDFs&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://www.adobe.com/products/acrviewer/acrvdnld.html" target="_blank"&gt;Adobe      AcrobatViewer for JavaBean&lt;/a&gt; - freeware, library to display and print      PDFs; &lt;a href="http://today.java.net/lpt/a/234" target="_blank"&gt;introductory article&lt;/a&gt; ;      this library hasn&amp;#39;t been updated in a long time and has problems      displaying files that were created with recent PDF versions.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="https://pdf-renderer.dev.java.net/" target="_blank"&gt;PDF Renderer&lt;/a&gt; is a more      up-to-date PDF viewer that renders using Java2D. It can also be used to &lt;a href="http://www.juixe.com/techknow/index.php/2008/01/17/print-a-pdf-document-in-java/" target="_blank"&gt;print      PDFs&lt;/a&gt;.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri; font-weight: bold;"&gt;PowerPoint&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;ul type="disc"&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;The Jakarta POI project      developed some code that can open and (to a limited extent) edit PPT      files. &lt;a href="http://jakarta.apache.org/poi/hslf/" target="_blank"&gt;This page&lt;/a&gt; talks      about it.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri; font-weight: bold;"&gt;Project&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;ul type="disc"&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;The &lt;a href="http://mpxj.sourceforge.net/" target="_blank"&gt;MPXJ library&lt;/a&gt; can work with several      Project file formats.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri; font-weight: bold;"&gt;QIF&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt; (used by Microsoft Money and Quicken) &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;ul type="disc"&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://buddi.thecave.homeunix.org/en/" target="_blank"&gt;Buddi&lt;/a&gt; and &lt;a href="http://eurobudget.sourceforge.net/" target="_blank"&gt;Eurobudget&lt;/a&gt; are Java      applications that can import and export QIF files (and thus contain code      you may be able to use in your application). Both are licensed under the      GPL.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri; font-weight: bold;"&gt;RTF&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;ul type="disc"&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://www.lowagie.com/iText/" target="_blank"&gt;iText&lt;/a&gt; - library to create RTFs &lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="https://javacc.dev.java.net/" target="_blank"&gt;JavaCC&lt;/a&gt; - is a lexer/parser for      which an RTF grammar is available. From that an RTF reader can be      constructed.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri; font-weight: bold;"&gt;Visio&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;ul type="disc"&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;The Jakarta POI project      developed some code that can read Visio files. &lt;a href="http://jakarta.apache.org/poi/hdgf/" target="_blank"&gt;This page&lt;/a&gt; talks about that.      &lt;/span&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri; font-weight: bold;"&gt;Word&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;ul type="disc"&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://jakarta.apache.org/poi/" target="_blank"&gt;POI&lt;/a&gt; - library to read and write      DOC files. (Note that according to the POI-Dev mailing list this is      unmaintained code. If it works for you - great, if not, then it will      likely not be fixed soon.) Slow progress is being made, though, and it can      be used for extracting the text of a document.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://dev.plutext.org/trac/docx4j" target="_blank"&gt;docx4j&lt;/a&gt; - for docx files (as      opposed to doc files)&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;&lt;a href="http://www.java400.de/en/default.html?../Javactpe.htm" target="_blank"&gt;WordApi.exe&lt;/a&gt;      is native Windows component with a Java interface, which lets you create      Word documents, and alter word templates. Some impressions about it can be      &lt;a href="http://radio.javaranch.com/val/2004/10/16/1097909528000.html" target="_blank"&gt;found      here&lt;/a&gt;.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri; font-weight: bold;"&gt;Something else?&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;p&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;If you encounter an obscure format for which no library is available, it may be feasible to create a reader for it if you have a file format description (which may be available on Wotsit, see link above). Several libraries, so-called &lt;i&gt;&lt;span style="font-style: italic;"&gt;lexers&lt;/span&gt;&lt;/i&gt; and &lt;i&gt;&lt;span style="font-style: italic;"&gt;parsers&lt;/span&gt;&lt;/i&gt;, are available that help in creating a reader, especially if the file format is ASCII, and not binary. You will need knowledge of regular expressions, though. Some file formats that have been tackled using this approach include RTF, CSV, HPGL and PBM/PGM/PPM. Lexers are easier to start with, but parsers can do more of the work for you. All these have ready-to-use examples on their web sites. &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;ul type="disc"&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;Lexers: &lt;a href="http://www.jflex.de/" target="_blank"&gt;JFlex&lt;/a&gt; (&lt;a href="http://www.javaranch.com/journal/2008/04/Journal200804.jsp#a4" target="_blank"&gt;introductory      article&lt;/a&gt; in the JavaRanch Journal)&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;&lt;span style="font-size: 11pt; font-family: Calibri;"&gt;Parsers: &lt;a href="http://www.antlr.org/" target="_blank"&gt;Antlr&lt;/a&gt;, &lt;a href="http://www.sablecc.org/" target="_blank"&gt;SableCC&lt;/a&gt;,      &lt;a href="https://javacc.dev.java.net/" target="_blank"&gt;JavaCC&lt;/a&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;font size="2" face="Tahoma"&gt;&lt;span style="font-size: 10pt; font-family: Tahoma;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-3519587390780739920?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/3519587390780739920/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=3519587390780739920' title='35 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/3519587390780739920'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/3519587390780739920'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/09/access-different-file-formats-in-java.html' title='Access different file formats in Java'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>35</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-6623350932860348155</id><published>2009-08-21T09:05:00.000-07:00</published><updated>2009-08-21T09:06:50.954-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='The markup in the document preceeding the root element must be well-formed'/><title type='text'>The markup in the document preceeding the root element must be well-formed</title><content type='html'>Check if this is correct:&lt;br /&gt;&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;br /&gt;1) All text content must be between a start and an end tag&lt;br /&gt;2) The document must have 1 root element&lt;br /&gt;3) every start tag must have a matching end tag&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-6623350932860348155?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/6623350932860348155/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=6623350932860348155' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/6623350932860348155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/6623350932860348155'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/markup-in-document-preceeding-root.html' title='The markup in the document preceeding the root element must be well-formed'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-1916490795685718237</id><published>2009-08-21T03:49:00.001-07:00</published><updated>2009-08-21T03:49:46.716-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WEB-INF'/><category scheme='http://www.blogger.com/atom/ns#' term='Directory structure of a web application'/><title type='text'>Directory structure of a web application, WEB-INF</title><content type='html'>&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;The directory structure of a web application                                       consists of two parts.&lt;br /&gt;                                      A private directory called WEB-INF&lt;br /&gt;                                      A public resource directory which contains                                       public resource folder.&lt;br /&gt;                                     &lt;br /&gt;                                      WEB-INF folder consists of&lt;br /&gt;                                      1. web.xml&lt;br /&gt;                                      2. classes directory&lt;br /&gt;                                      3. lib directory&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-1916490795685718237?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/1916490795685718237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=1916490795685718237' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1916490795685718237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1916490795685718237'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/directory-structure-of-web-application.html' title='Directory structure of a web application, WEB-INF'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-996376933121954629</id><published>2009-08-21T03:46:00.000-07:00</published><updated>2009-08-21T03:47:03.366-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Life cycle methods of a Servlet'/><title type='text'>Life cycle methods of a Servlet</title><content type='html'>&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;The javax.servlet.Servlet interface defines the three methods known as life-cycle method.&lt;br /&gt;public void init(ServletConfig config) throws ServletException&lt;br /&gt;public void service( ServletRequest req, ServletResponse res) throws ServletException, IOException&lt;br /&gt;public void destroy()&lt;br /&gt;First the servlet is constructed, then initialized wih the init() method.&lt;br /&gt;Any request from client are handled initially by the service() method before delegating to the doXxx() methods in the case of HttpServlet.&lt;br /&gt;&lt;br /&gt;The servlet is removed from service, destroyed with the destroy() methid, then garbaged collected and finalized&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-996376933121954629?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/996376933121954629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=996376933121954629' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/996376933121954629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/996376933121954629'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/life-cycle-methods-of-servlet.html' title='Life cycle methods of a Servlet'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-851513878807095917</id><published>2009-08-21T03:42:00.001-07:00</published><updated>2009-08-21T03:42:48.950-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Methods of the javax.servlet.Servlet interface'/><title type='text'>Methods of the javax.servlet.Servlet interface</title><content type='html'>init() This method is called by the servlet container to indicate to the servlet&lt;br /&gt;that it must initialize itself and get ready for service. The container&lt;br /&gt;passes an object of type ServletConfig as a parameter.&lt;br /&gt;&lt;br /&gt;service() This method is called by the servlet container for each request from the&lt;br /&gt;client to allow the servlet to respond to the request.&lt;br /&gt;&lt;br /&gt;destroy() This method is called by the servlet container to indicate to the servlet&lt;br /&gt;that it must clean up itself, release any required resources, and get ready&lt;br /&gt;to go out of service.&lt;br /&gt;&lt;br /&gt;getServletConfig() Returns information about the servlet, such as a parameter to the&lt;br /&gt;init() method.&lt;br /&gt;&lt;br /&gt;getServletInfo() The implementation class must return information about the servlet,&lt;br /&gt;such as the author, the version, and copyright information&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-851513878807095917?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/851513878807095917/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=851513878807095917' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/851513878807095917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/851513878807095917'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/methods-of-javaxservletservlet.html' title='Methods of the javax.servlet.Servlet interface'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-8199696221695795974</id><published>2009-08-21T03:21:00.000-07:00</published><updated>2009-08-21T03:23:51.351-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Communicating with Objects by Waiting and Notifying'/><title type='text'>Communicating with Objects by Waiting and Notifying</title><content type='html'>The wait() method lets a thread to be added to a waiting pool, unless it is invoked again to run&lt;br /&gt; The notify() method is used to send a signal to one and only one of the threads that are waiting in that same object's waiting pool.&lt;br /&gt; The notify() method can NOT specify which waiting thread to notify.&lt;br /&gt; The method notifyAll() works in the same way as notify(), only it sends the signal to all of the threads waiting on the object.&lt;br /&gt; All three methods—wait(), notify(), and notifyAll()—must be called from within a synchronized context! A thread invokes wait() or notify() on a particular object, and the thread must currently hold the lock on that object.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-8199696221695795974?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/8199696221695795974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=8199696221695795974' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8199696221695795974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8199696221695795974'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/communicating-with-objects-by-waiting.html' title='Communicating with Objects by Waiting and Notifying'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-1588658924042867929</id><published>2009-08-21T03:20:00.000-07:00</published><updated>2009-08-21T03:21:55.777-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Concurrent Access Problems'/><category scheme='http://www.blogger.com/atom/ns#' term='Synchronized Threads'/><title type='text'>Concurrent Access Problems ,Synchronized Threads</title><content type='html'>synchronized methods prevent more than one thread from accessing an object's critical method code simultaneously.&lt;br /&gt; You can use the synchronized keyword as a method modifier, or to start a synchronized block of code.&lt;br /&gt; To synchronize a block of code (in other words, a scope smaller than the whole method), you must specify an argument that is the object whose lock you want to synchronize on.&lt;br /&gt; While only one thread can be accessing synchronized code of a particular instance, multiple threads can still access the same object's unsynchronized code.&lt;br /&gt; When a thread goes to sleep, its locks will be unavailable to other threads.&lt;br /&gt; static methods can be synchronized, using the lock from the java.lang.Class instance representing that class.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-1588658924042867929?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/1588658924042867929/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=1588658924042867929' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1588658924042867929'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1588658924042867929'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/concurrent-access-problems-synchronized.html' title='Concurrent Access Problems ,Synchronized Threads'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-1631712173681374235</id><published>2009-08-21T03:18:00.000-07:00</published><updated>2009-08-21T03:20:22.581-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Yield'/><category scheme='http://www.blogger.com/atom/ns#' term='Sleep'/><category scheme='http://www.blogger.com/atom/ns#' term='and Join'/><title type='text'>Sleep, Yield, and Join</title><content type='html'>Sleeping is used to delay execution for a period of time, and no locks are released when a thread goes to sleep.&lt;br /&gt; A sleeping thread is guaranteed to sleep for at least the time specified in the argument to the sleep() method (unless it's interrupted), but there is no guarantee as to when the newly awakened thread will actually return to running.&lt;br /&gt; The sleep() method is a static method that sleeps the currently executing thread's state. One thread cannot tell another thread to sleep.&lt;br /&gt; The setPriority() method is used on Thread objects to give threads a priority of between 1 (low) and 10 (high), although priorities are not guaranteed, and not all JVMs recognize 10 distinct priority levels—some levels may be treated as effectively equal.&lt;br /&gt; If not explicitly set, a thread's priority will have the same priority as the priority of the thread that created it.&lt;br /&gt; The yield() method may cause a running thread to back out if there are runnable threads of the same priority. There is no guarantee that this will happen, and there is no guarantee that when the thread backs out there will be a different thread selected to run. A thread might yield and then immediately reenter the running state.&lt;br /&gt; The closest thing to a guarantee is that at any given time, when a thread is running it will usually not have a lower priority than any thread in therunnable state. If a low-priority thread is running when a high-priority thread enters runnable, the JVM will usually preempt the running low-priority thread and put the high-priority thread in.&lt;br /&gt; When one thread calls the join() method of another thread, the currently running thread will wait until the thread it joins with has completed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-1631712173681374235?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/1631712173681374235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=1631712173681374235' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1631712173681374235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1631712173681374235'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/sleep-yield-and-join.html' title='Sleep, Yield, and Join'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-7304910668524355079</id><published>2009-08-21T03:16:00.000-07:00</published><updated>2009-08-21T03:18:01.889-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Thread States'/><category scheme='http://www.blogger.com/atom/ns#' term='Transitioning Between Thread States'/><title type='text'>Transitioning Between Thread States,  Thread States</title><content type='html'>Once a new thread is started, it will always enter the runnable state.&lt;br /&gt;The thread scheduler can move a thread back and forth between the runnable state and the running state.&lt;br /&gt; For a typical single-processor machine, only one thread can be running at a time, although many threads may be in the runnable state.&lt;br /&gt; There is no guarantee that the order in which threads were started determines the order in which they'll run.&lt;br /&gt;  There's no guarantee that threads will take turns in any fair way. It's up to the thread scheduler, as determined by the particular virtual machine implementation. If you want a guarantee that your threads will take turns regardless of the underlying JVM, you can use the sleep() method. This prevents one thread from hogging the running process while another thread starves. (In most cases, though, yield() works well enough to encourage&lt;br /&gt;your threads to play together nicely.)&lt;br /&gt; A running thread may enter a blocked/waiting state by a wait(), sleep(), or join() call.&lt;br /&gt;A running thread may enter a blocked/waiting state because it can't acquire the lock for a synchronized block of code.&lt;br /&gt; When the sleep or wait is over, or an object's lock becomes available, thethread can only reenter the runnable state. It will go directly from waiting to running (well, for all practical purposes anyway).&lt;br /&gt; A dead thread cannot be started again&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-7304910668524355079?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/7304910668524355079/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=7304910668524355079' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7304910668524355079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7304910668524355079'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/transitioning-between-thread-states.html' title='Transitioning Between Thread States,  Thread States'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-8076724072058355798</id><published>2009-08-21T03:10:00.000-07:00</published><updated>2009-08-21T03:15:47.516-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Instantiating'/><category scheme='http://www.blogger.com/atom/ns#' term='Defining'/><category scheme='http://www.blogger.com/atom/ns#' term='Starting Threads'/><title type='text'>Defining, Instantiating, Starting Threads</title><content type='html'>Threads can be created by extending Thread and overriding the public void run() method.&lt;br /&gt;Thread objects can also be created by calling the Thread constructor that takes a Runnable argument. The Runnable object is said to be the target of the thread.&lt;br /&gt;You can call start() on a Thread object only once. If start() is called more than once on a Thread object, it will throw a RuntimeException.&lt;br /&gt; It is legal to create many Thread objects using the same Runnable object as the target.&lt;br /&gt; When a Thread object is created, it does not become a thread of execution until its start() method is invoked. When a Thread object exists but hasn't been started, it is in the new state and is not considered alive.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-8076724072058355798?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/8076724072058355798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=8076724072058355798' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8076724072058355798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8076724072058355798'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/defining-instantiating-starting-threads.html' title='Defining, Instantiating, Starting Threads'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-7962139645596445693</id><published>2009-08-21T03:07:00.000-07:00</published><updated>2009-08-21T03:08:26.675-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Utility Classes: Collections and Arrays'/><title type='text'>Utility Classes: Collections and Arrays</title><content type='html'>Both of these java.util classes provide&lt;br /&gt; A sort() method. Sort using a Comparator or sort using natural order.&lt;br /&gt; A binarySearch() method. Search a pre-sorted array or List.&lt;br /&gt; Arrays.asList() creates a List from an array and links them together.&lt;br /&gt; Collections.reverse() reverses the order of elements in a List.&lt;br /&gt; Collections.reverseOrder() returns a Comparator that sorts in reverse.&lt;br /&gt; Lists and Sets have a toArray() method to create arrays&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-7962139645596445693?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/7962139645596445693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=7962139645596445693' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7962139645596445693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7962139645596445693'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/utility-classes-collections-and-arrays.html' title='Utility Classes: Collections and Arrays'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-3622527597978225642</id><published>2009-08-21T03:06:00.000-07:00</published><updated>2009-08-21T03:07:21.336-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sorting and Searching Arrays and Lists'/><title type='text'>Sorting and Searching Arrays and Lists</title><content type='html'>Sorting can be in natural order, or via a Comparable or many Comparators.&lt;br /&gt; Implement Comparable using compareTo(); provides only one sort order.&lt;br /&gt; Create many Comparators to sort a class many ways; implement compare().&lt;br /&gt; To be sorted and searched, a List's elements must be comparable.&lt;br /&gt; To be searched, an array or List must first be sorted&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-3622527597978225642?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/3622527597978225642/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=3622527597978225642' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/3622527597978225642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/3622527597978225642'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/sorting-and-searching-arrays-and-lists.html' title='Sorting and Searching Arrays and Lists'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-8543035851417042121</id><published>2009-08-21T03:04:00.000-07:00</published><updated>2009-08-21T03:06:02.483-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Key Attributes of Common Collection Classes'/><title type='text'>Key Attributes of Common Collection Classes</title><content type='html'>ArrayList: Fast iteration and fast random access.&lt;br /&gt; Vector: It's like a slower ArrayList, but it has synchronized methods.&lt;br /&gt; LinkedList: Good for adding elements to the ends, i.e., stacks and queues.&lt;br /&gt; HashSet: Fast access, assures no duplicates, provides no ordering.&lt;br /&gt; LinkedHashSet: No duplicates; iterates by insertion order.&lt;br /&gt; TreeSet: No duplicates; iterates in sorted order.&lt;br /&gt; HashMap: Fastest updates (key/value pairs); allows one null key,many null values.&lt;br /&gt; Hashtable: Like a slower HashMap (as with Vector, due to its synchronized methods). No null values or null keys allowed.&lt;br /&gt; LinkedHashMap: Faster iterations; iterates by insertion order or last accessed;allows one null key, many null values.&lt;br /&gt; TreeMap: A sorted map.&lt;br /&gt; PriorityQueue: A to-do list ordered by the elements' priority.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-8543035851417042121?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/8543035851417042121/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=8543035851417042121' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8543035851417042121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8543035851417042121'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/key-attributes-of-common-collection.html' title='Key Attributes of Common Collection Classes'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-782708751571974097</id><published>2009-08-21T02:45:00.000-07:00</published><updated>2009-08-21T03:03:12.544-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Collections'/><title type='text'>Collections</title><content type='html'>Common collection activities include adding objects, removing objects, verifying object inclusion, retrieving objects, and iterating.&lt;br /&gt; Three meanings for "collection":&lt;br /&gt;* collection: Represents the data structure in which objects are stored&lt;br /&gt;* Collection: java.util interface from which Set and List extend&lt;br /&gt;* Collections: A class that holds static collection utility methods&lt;br /&gt;&lt;br /&gt; Four basic flavors of collections include Lists, Sets, Maps, Queues:&lt;br /&gt;* Lists of things Ordered, duplicates allowed, with an index.&lt;br /&gt;* Sets of things May or may not be ordered and/or sorted; duplicates&lt;br /&gt;not allowed.&lt;br /&gt;* Maps of things with keys May or may not be ordered and/or sorted;duplicate keys are not allowed.&lt;br /&gt;* Queues of things to process Ordered by FIFO or by priority.&lt;br /&gt;&lt;br /&gt; Four basic sub-flavors of collections Sorted, Unsorted, Ordered, Unordered.&lt;br /&gt;* Ordered Iterating through a collection in a specific, non-random order.&lt;br /&gt;* Sorted Iterating through a collection in a sorted order.&lt;br /&gt;* Sorting can be alphabetic, numeric, or programmer-defined&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-782708751571974097?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/782708751571974097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=782708751571974097' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/782708751571974097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/782708751571974097'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/collections.html' title='Collections'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-716707392710949345</id><published>2009-08-21T02:37:00.000-07:00</published><updated>2009-08-21T02:45:16.081-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Overriding hashCode() and equals()'/><title type='text'>Overriding hashCode() and equals()</title><content type='html'>* equals(), hashCode(), and toString() are public.&lt;br /&gt;* Override toString() so that System.out.println() or other methods can see something useful, like your object's state.&lt;br /&gt;* Use == to determine if two reference variables refer to the same object.&lt;br /&gt;* Use equals() to determine if two objects are meaningfully equivalent.&lt;br /&gt;* If you don't override equals(), your objects won't be useful hashing keys.&lt;br /&gt;* If you don't override equals(), different objects can't be considered equal.&lt;br /&gt;* Strings and wrappers override equals() and make good hashing keys.&lt;br /&gt;* When overriding equals(), use the instanceof operator to be sure you're evaluating an appropriate class.&lt;br /&gt;* When overriding equals(), compare the objects' significant attributes.&lt;br /&gt;* Highlights of the equals() contract:&lt;br /&gt; Reflexive: x.equals(x) is true.&lt;br /&gt; Symmetric: If x.equals(y) is true, then y.equals(x) must be true.&lt;br /&gt; Transitive: If x.equals(y) is true, and y.equals(z) is true,then z.equals(x) is true.&lt;br /&gt; Consistent: Multiple calls to x.equals(y) will return the same result.&lt;br /&gt; Null: If x is not null, then x.equals(null) is false.&lt;br /&gt; If x.equals(y) is true, then x.hashCode() == y.hashCode() is true.&lt;br /&gt; If you override equals(), override hashCode().&lt;br /&gt;&lt;br /&gt;*HashMap, HashSet, Hashtable, LinkedHashMap, &amp;amp; LinkedHashSet use hashing.&lt;br /&gt;* An efficient hashCode() override distributes keys evenly across its buckets.&lt;br /&gt;* An overridden equals() must be at least as precise as its hashCode() mate.&lt;br /&gt;* To reiterate: if two objects are equal, their hashcodes must be equal.&lt;br /&gt;* It's legal for a hashCode() method to return the same value for all instances&lt;br /&gt;(although in practice it's very inefficient).&lt;br /&gt;&lt;br /&gt; Highlights of the hashCode() contract:&lt;br /&gt;* Consistent: multiple calls to x.hashCode() return the same integer.&lt;br /&gt;* If x.equals(y) is true, x.hashCode() == y.hashCode() is true.&lt;br /&gt;q If x.equals(y) is false, then x.hashCode() == y.hashCode() can be either true or false, but false will tend to create better efficiency.&lt;br /&gt;* transient variables aren't appropriate for equals() and hashCode().&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-716707392710949345?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/716707392710949345/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=716707392710949345' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/716707392710949345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/716707392710949345'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/overriding-hashcode-and-equals.html' title='Overriding hashCode() and equals()'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-2398687211308112222</id><published>2009-08-21T02:14:00.000-07:00</published><updated>2009-08-21T02:17:22.132-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Serialization'/><title type='text'>Serialization</title><content type='html'>The classes you need to understand are all in the java.io package; they include: ObjectOutputStream and ObjectInputStream primarily, and FileOutputStream and FileInputStream because you will use them to create the low-level streams that the ObjectXxxStream classes will use.&lt;br /&gt;* A class must implement the Serializable interface before its objects can be&lt;br /&gt;serialized.&lt;br /&gt;* The ObjectOutputStream.writeObject() method serializes objects, and the ObjectInputStream.readObject() method deserializes objects.&lt;br /&gt;* If you mark an instance variable transient, it will not be serialized even thought the rest of the object's state will be.&lt;br /&gt;* You can supplement a class's automatic serialization process by implementing the writeObject() and readObject() methods. If you do this, embedding calls to defaultWriteObject() and defaultReadObject(), respectively, will handle the part of serialization that happens normally.&lt;br /&gt;* If a superclass implements Serializable, then its subclasses do automatically.&lt;br /&gt;* If a superclass doesn't implement Serializable, then when a subclass object is deserialized, the superclass constructor will run.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-2398687211308112222?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/2398687211308112222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=2398687211308112222' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/2398687211308112222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/2398687211308112222'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/serialization.html' title='Serialization'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-8308088822703884400</id><published>2009-08-21T02:12:00.000-07:00</published><updated>2009-08-21T02:14:35.524-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Using String'/><category scheme='http://www.blogger.com/atom/ns#' term='and StringBuilder'/><category scheme='http://www.blogger.com/atom/ns#' term='StringBuffer'/><title type='text'>Using String, StringBuffer, and StringBuilder</title><content type='html'>String objects are immutable, and String reference variables are not.&lt;br /&gt;  If you create a new String without assigning it, it will be lost to your program.&lt;br /&gt;  If you redirect a String reference to a new String, the old String can be lost.&lt;br /&gt; String methods use zero-based indexes, except for the second argument of substring().&lt;br /&gt; The String class is final—its methods can't be overridden.&lt;br /&gt; When the JVM finds a String literal, it is added to the String literal pool.&lt;br /&gt; Strings have a method: length(), arrays have an attribute named length.&lt;br /&gt; The StringBuffer's API is the same as the new StringBuilder's API, except that StringBuilder's methods are not synchronized for thread safety.&lt;br /&gt; StringBuilder methods should run faster than StringBuffer methods.&lt;br /&gt; All of the following bullets apply to both StringBuffer and StringBuilder:&lt;br /&gt;* They are mutable—they can change without creating a new object.&lt;br /&gt;* StringBuffer methods act on the invoking object, and objects can change without an explicit assignment in the statement.&lt;br /&gt;* StringBuffer equals() is not overridden; it doesn't compare values.&lt;br /&gt;* Remember that chained methods are evaluated from left to right.&lt;br /&gt;* String methods to remember: charAt(), concat(), equalsIgnoreCase(), length(), replace(), substring(), toLowerCase(), toString(), toUpperCase(), and trim().&lt;br /&gt;* Stringbuffer methods to remember: append(), delete(), insert(), reverse(), and toString()&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-8308088822703884400?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/8308088822703884400/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=8308088822703884400' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8308088822703884400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8308088822703884400'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/using-string-stringbuffer-and.html' title='Using String, StringBuffer, and StringBuilder'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-1338857911081145992</id><published>2009-08-21T02:03:00.000-07:00</published><updated>2009-08-21T02:11:05.294-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Exceptions'/><category scheme='http://www.blogger.com/atom/ns#' term='Handling Exceptions'/><category scheme='http://www.blogger.com/atom/ns#' term='Exception handling'/><title type='text'>Handling Exceptions, Exception Handling, Exceptions</title><content type='html'>Exceptions come in two flavors: checked and unchecked.&lt;br /&gt;&lt;br /&gt; Checked exceptions include all subtypes of Exception, excluding classes that extend RuntimeException.&lt;br /&gt;&lt;br /&gt; Checked exceptions are subject to the handle or declare rule; any methodthat might throw a checked exception (including methods that invoke methods that can throw a checked exception) must either declare the exception using throws, or handle the exception with an appropriate try/catch.&lt;br /&gt; Subtypes of Error or RuntimeException are unchecked, so the compiler doesn't enforce the handle or declare rule. You're free to handle them, or to declare them, but the compiler doesn't care one way or the other.&lt;br /&gt; If you use an optional finally block, it will always be invoked, regardless of whether an exception in the corresponding try is thrown or not, and regardless of whether a thrown exception is caught or not.&lt;br /&gt; The only exception to the finally-will-always-be-called rule is that a finally will not be invoked if the JVM shuts down. That could happen if code from the try or catch blocks calls System.exit().&lt;br /&gt; Just because finally is invoked does not mean it will complete. Code in the finally block could itself raise an exception or issue a System.exit().&lt;br /&gt; Uncaught exceptions propagate back through the call stack, starting from the method where the exception is thrown and ending with either the first method that has a corresponding catch for that exception type or a JVM shutdown (which happens if the exception gets to main(), and main() is "ducking" the exception by declaring it).&lt;br /&gt; You can create your own exceptions, normally by extending Exception or one of its subtypes. Your exception will then be considered a checked exception, and the compiler will enforce the handle or declare rule for that exception.&lt;br /&gt; All catch blocks must be ordered from most specific to most general.&lt;br /&gt;If you have a catch clause for both IOException and Exception, you must put the catch for IOException first in your code. Otherwise, the IOException would be caught by catch(Exception e), because a catch argument can catch the specified exception or any of its subtypes! The compiler will stop you from defining catch clauses that can never be reached.&lt;br /&gt; Some exceptions are created by programmers, some by the JVM.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Unchecked exceptions : &lt;/span&gt;&lt;ul&gt;&lt;li&gt; represent &lt;span class="highlight"&gt;defects in the program (bugs)&lt;/span&gt; - often invalid arguments passed to a non-private method. To quote from &lt;em&gt;The Java Programming Language&lt;/em&gt;, by Gosling,  Arnold, and Holmes : "Unchecked runtime exceptions represent conditions that,  generally speaking, reflect errors in your program's logic and cannot be reasonably  recovered from at run time." &lt;/li&gt;&lt;li&gt; are subclasses of &lt;tt&gt;&lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/RuntimeException.html"&gt;RuntimeException&lt;/a&gt;&lt;/tt&gt;, and are usually implemented using  &lt;tt&gt;&lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html"&gt;IllegalArgumentException&lt;/a&gt;&lt;/tt&gt;,  &lt;tt&gt;&lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/NullPointerException.html"&gt;NullPointerException&lt;/a&gt;&lt;/tt&gt;, or &lt;tt&gt;&lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/IllegalStateException.html"&gt;IllegalStateException&lt;/a&gt;&lt;/tt&gt;&lt;/li&gt;&lt;li&gt; a method is &lt;i&gt;not&lt;/i&gt; obliged to establish a policy for the unchecked exceptions thrown by its implementation (and they almost always do not do so)&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Checked exceptions : &lt;/span&gt;&lt;ul&gt;&lt;li&gt; represent &lt;span class="highlight"&gt;invalid conditions in areas outside the immediate control of the program&lt;/span&gt; (invalid user input, database problems, network outages, absent files)&lt;/li&gt;&lt;li&gt; are subclasses of &lt;tt&gt;&lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html"&gt;Exception&lt;/a&gt;&lt;/tt&gt;&lt;/li&gt;&lt;li&gt; a method is &lt;i&gt;obliged&lt;/i&gt; to establish a policy for all checked exceptions thrown by its implementation (either pass the checked exception further up the stack, or handle it somehow)&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-1338857911081145992?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/1338857911081145992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=1338857911081145992' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1338857911081145992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1338857911081145992'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/handling-exceptions-exception-handling.html' title='Handling Exceptions, Exception Handling, Exceptions'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-4583801339572184323</id><published>2009-08-21T00:55:00.000-07:00</published><updated>2009-08-21T00:56:00.680-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Try'/><category scheme='http://www.blogger.com/atom/ns#' term='Finally'/><category scheme='http://www.blogger.com/atom/ns#' term='Catch'/><title type='text'>Try, Catch , Finally</title><content type='html'>It is illegal to use a try clause without either a catch clause or a finally&lt;br /&gt;clause. A try clause by itself will result in a compiler error. Any catch clauses must&lt;br /&gt;immediately follow the try block. Any finally clause must immediately follow the last&lt;br /&gt;catch clause (or it must immediately follow the try block if there is no catch). It is legal&lt;br /&gt;to omit either the catch clause or the finally clause, but not both&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-4583801339572184323?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/4583801339572184323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=4583801339572184323' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/4583801339572184323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/4583801339572184323'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/try-catch-finally.html' title='Try, Catch , Finally'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-7658463383261150184</id><published>2009-08-21T00:45:00.000-07:00</published><updated>2009-08-21T00:46:02.567-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Initialization Blocks'/><title type='text'>Initialization Blocks</title><content type='html'>Static initialization blocks run once, when the class is first loaded.&lt;br /&gt; Instance initialization blocks run every time a new instance is created. They run after all super-constructors and before the constructor's code has run.&lt;br /&gt; If multiple init blocks exist in a class, they follow the rules stated above, AND they run in the order in which they appear in the source file&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-7658463383261150184?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/7658463383261150184/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=7658463383261150184' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7658463383261150184'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7658463383261150184'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/initialization-blocks.html' title='Initialization Blocks'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-1151222856490005463</id><published>2009-08-21T00:43:00.000-07:00</published><updated>2009-08-21T00:44:35.111-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Passing Variables into Methods'/><title type='text'>Passing Variables into Methods</title><content type='html'>Methods can take primitives and/or object references as arguments.&lt;br /&gt; Method arguments are always copies.&lt;br /&gt; Method arguments are never actual objects (they can be references to objects).&lt;br /&gt; A primitive argument is an unattached copy of the original primitive.&lt;br /&gt; A reference argument is another copy of a reference to the original object&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-1151222856490005463?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/1151222856490005463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=1151222856490005463' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1151222856490005463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1151222856490005463'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/passing-variables-into-methods.html' title='Passing Variables into Methods'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-3723130241401609983</id><published>2009-08-21T00:42:00.000-07:00</published><updated>2009-08-21T00:43:10.193-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Using a Variable or Array Element That Is Uninitialized and Unassigned'/><title type='text'>Using a Variable or Array Element That Is Uninitialized and Unassigned</title><content type='html'>When an array of objects is instantiated, objects within the array are not instantiated automatically, but all the references get the default value of null.&lt;br /&gt; When an array of primitives is instantiated, elements get default values.&lt;br /&gt; Instance variables are always initialized with a default value.&lt;br /&gt;qLocal/automatic/method variables are never given a default value. If you attempt to use one before initializing it, you'll get a compiler error&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-3723130241401609983?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/3723130241401609983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=3723130241401609983' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/3723130241401609983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/3723130241401609983'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/using-variable-or-array-element-that-is.html' title='Using a Variable or Array Element That Is Uninitialized and Unassigned'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-2187512206395616028</id><published>2009-08-21T00:38:00.001-07:00</published><updated>2009-08-21T00:38:39.213-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Object Creation'/><title type='text'>Object Creation</title><content type='html'>When creating a new object, e.g., Button b = new Button();, three&lt;br /&gt;things happen:&lt;br /&gt; Make a reference variable named b, of type Button&lt;br /&gt; Create a new Button object&lt;br /&gt; Assign the Button object to the reference variable b&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-2187512206395616028?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/2187512206395616028/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=2187512206395616028' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/2187512206395616028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/2187512206395616028'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/object-creation.html' title='Object Creation'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-5989427898654496817</id><published>2009-08-21T00:36:00.000-07:00</published><updated>2009-08-21T00:37:31.956-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scope'/><title type='text'>Scope</title><content type='html'>Scope refers to the lifetime of a variable.&lt;br /&gt;There are four basic scopes:&lt;br /&gt;   Static variables live basically as long as their class lives.&lt;br /&gt;  Instance variables live as long as their object lives.&lt;br /&gt;  Local variables live as long as their method is on the stack; however, if their method invokes another method, they are temporarily unavailable.&lt;br /&gt;  Block variables (e.g.., in a for or an if) live until the block completes&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-5989427898654496817?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/5989427898654496817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=5989427898654496817' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5989427898654496817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5989427898654496817'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/scope.html' title='Scope'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-1707108487756161314</id><published>2009-08-21T00:32:00.000-07:00</published><updated>2009-08-21T00:33:01.563-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Stack and Heap'/><title type='text'>Stack and Heap</title><content type='html'>Local variables (method variables) live on the stack.&lt;br /&gt;Objects and their instance variables live on the heap&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-1707108487756161314?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/1707108487756161314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=1707108487756161314' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1707108487756161314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1707108487756161314'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/stack-and-heap.html' title='Stack and Heap'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-7372084004225821187</id><published>2009-08-20T23:36:00.003-07:00</published><updated>2009-08-20T23:36:58.508-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Coupling'/><category scheme='http://www.blogger.com/atom/ns#' term='Cohesion'/><category scheme='http://www.blogger.com/atom/ns#' term='Coupling and Cohesion'/><title type='text'>Coupling and Cohesion, Coupling, Cohesion</title><content type='html'>Coupling refers to the degree to which one class knows about or uses members of another class.&lt;br /&gt; Loose coupling is the desirable state of having classes that are well encapsulated, minimize references to each other, and limit the breadth of API usage.&lt;br /&gt; Tight coupling is the undesirable state of having classes that break the rules of loose coupling.&lt;br /&gt; Cohesion refers to the degree in which a class has a single, well-defined role or responsibility.&lt;br /&gt; High cohesion is the desirable state of a class whose members support a single, well-focused role or responsibility.&lt;br /&gt; Low cohesion is the undesirable state of a class whose members support multiple, unfocused roles or responsibilities.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-7372084004225821187?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/7372084004225821187/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=7372084004225821187' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7372084004225821187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7372084004225821187'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/coupling-and-cohesion-coupling-cohesion.html' title='Coupling and Cohesion, Coupling, Cohesion'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-5910978325624990573</id><published>2009-08-20T23:36:00.001-07:00</published><updated>2009-08-20T23:36:27.963-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Statics'/><title type='text'>Statics</title><content type='html'>Use static methods to implement behaviors that are not affected by the state of any instances.&lt;br /&gt; Use static variables to hold data that is class specific as opposed to instance specific—there will be only one copy of a static variable.&lt;br /&gt; All static members belong to the class, not to any instance.&lt;br /&gt; A static method can't access an instance variable directly.&lt;br /&gt; Use the dot operator to access static members, but remember that using a reference variable with the dot operator is really a syntax trick, and the compiler will substitute the class name for the reference variable, for instance:&lt;br /&gt;    d.doStuff();&lt;br /&gt;    becomes:&lt;br /&gt;    Dog.doStuff();&lt;br /&gt; static methods can't be overridden, but they can be redefined.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-5910978325624990573?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/5910978325624990573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=5910978325624990573' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5910978325624990573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5910978325624990573'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/statics.html' title='Statics'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-1421878892553251041</id><published>2009-08-20T23:35:00.000-07:00</published><updated>2009-08-20T23:36:04.178-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Constructors and Instantiation'/><title type='text'>Constructors and Instantiation</title><content type='html'>You cannot create a new object without invoking a constructor.&lt;br /&gt; Each superclass in an object's inheritance tree will have a constructor called.&lt;br /&gt; Every class, even an abstract class, has at least one constructor.&lt;br /&gt; Constructors must have the same name as the class.&lt;br /&gt; Constructors don't have a return type. If the code you're looking at has a return type, it's a method with the same name as the class, and a constructor.&lt;br /&gt; Typical constructor execution occurs as follows:&lt;br /&gt;    The constructor calls its superclass constructor, which calls its superclass constructor, and so on all the way up to the Object constructor.&lt;br /&gt;    The Object constructor executes and then returns to the calling constructor, which runs to completion and then returns to its calling&lt;br /&gt;constructor, and so on back down to the completion of the constructor of the actual instance being created.&lt;br /&gt; Constructors can use any access modifier (even private!).&lt;br /&gt; The compiler will create a default constructor if you don't create any constructors in your class.&lt;br /&gt; The default constructor is a no-arg constructor with a no-arg call to super().&lt;br /&gt; The first statement of every constructor must be a call to either this(), (an overloaded constructor), or super().&lt;br /&gt; The compiler will add a call to super() if you do not, unless you have already put in a call to this().&lt;br /&gt; Instance members are accessible only after the super constructor runs.&lt;br /&gt; Abstract classes have constructors that are called when a concrete subclass is instantiated.&lt;br /&gt; Interfaces do not have constructors.&lt;br /&gt; If your superclass does not have a no-arg constructor, you must create a constructor and insert a call to super() with arguments matching those&lt;br /&gt;of the superclass constructor.&lt;br /&gt; Constructors are never inherited, thus they cannot be overridden.&lt;br /&gt; A constructor can be directly invoked only by another constructor (using a call to super() or this()).&lt;br /&gt; Issues with calls to this():&lt;br /&gt;    May appear only as the first statement in a constructor.&lt;br /&gt;    The argument list determines which overloaded constructor is called.&lt;br /&gt;Constructors can call constructors can call constructors, and so on, but sooner or later one of them better call super() or the stack will explode.&lt;br /&gt; Calls to this() and super() cannot be in the same constructor. You can have one or the other, but never both&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-1421878892553251041?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/1421878892553251041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=1421878892553251041' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1421878892553251041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1421878892553251041'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/constructors-and-instantiation.html' title='Constructors and Instantiation'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-7322363386116541888</id><published>2009-08-20T23:34:00.002-07:00</published><updated>2009-08-20T23:35:12.938-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Return Types'/><title type='text'>Return Types</title><content type='html'>Overloaded methods can change return types; overridden methods cannot, except in the case of covariant returns.&lt;br /&gt; Object reference return types can accept null as a return value.&lt;br /&gt; An array is a legal return type, both to declare and return as a value.&lt;br /&gt; For methods with primitive return types, any value that can be implicitly converted to the return type can be returned.&lt;br /&gt; Nothing can be returned from a void, but you can return nothing. You're allowed to simply say return, in any method with a void return type, to bust out of a method early. But you can't return nothing from a method with a non-void return type.&lt;br /&gt; Methods with an object reference return type, can return a subtype.&lt;br /&gt; Methods with an interface return type, can return any implementer&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-7322363386116541888?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/7322363386116541888/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=7322363386116541888' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7322363386116541888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7322363386116541888'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/return-types.html' title='Return Types'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-5289022560368257135</id><published>2009-08-20T23:34:00.001-07:00</published><updated>2009-08-20T23:34:41.772-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Implementing an Interface'/><title type='text'>Implementing an Interface</title><content type='html'>When you implement an interface, you are fulfilling its contract.&lt;br /&gt; You implement an interface by properly and concretely overriding all of the methods defined by the interface.&lt;br /&gt; A single class can implement many interfaces.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-5289022560368257135?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/5289022560368257135/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=5289022560368257135' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5289022560368257135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5289022560368257135'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/implementing-interface.html' title='Implementing an Interface'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-5356957794242690057</id><published>2009-08-20T23:33:00.001-07:00</published><updated>2009-08-20T23:33:57.489-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Upcasting'/><category scheme='http://www.blogger.com/atom/ns#' term='Downcasting'/><category scheme='http://www.blogger.com/atom/ns#' term='Reference Variable Casting'/><title type='text'>Reference Variable Casting, Upcasting, DowncastingReference Variable Casting</title><content type='html'>There are two types of reference variable casting: downcasting and upcasting.&lt;br /&gt;Downcasting: If you have a reference variable that refers to a subtype object,you can assign it to a reference variable of the subtype. You must make an explicit cast to do this, and the result is that you can access the subtype's members with this new reference variable.&lt;br /&gt;Upcasting: You can assign a reference variable to a supertype reference variable explicitly or implicitly. This is an inherently safe operation because the assignment restricts the access capabilities of the new variable&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-5356957794242690057?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/5356957794242690057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=5356957794242690057' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5356957794242690057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5356957794242690057'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/reference-variable-casting-upcasting.html' title='Reference Variable Casting, Upcasting, DowncastingReference Variable Casting'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-369664270646265838</id><published>2009-08-20T23:30:00.002-07:00</published><updated>2009-08-20T23:32:00.180-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Overriding'/><category scheme='http://www.blogger.com/atom/ns#' term='Overriding and Overloading'/><category scheme='http://www.blogger.com/atom/ns#' term='Overloading'/><title type='text'>Overriding and Overloading, Overloading, Overriding</title><content type='html'>Methods can be overridden or overloaded; constructors can be overloaded but not overridden.&lt;br /&gt; Abstract methods must be overridden by the first concrete (nonabstract) subclass.&lt;br /&gt; With respect to the method it overrides, the overriding method&lt;br /&gt;    Must have the same argument list&lt;br /&gt;    Must have the same return type, except that as of Java 5, the return type can be a subclass—this is known as a covariant return.&lt;br /&gt;    Must not have a more restrictive access modifier&lt;br /&gt;    May have a less restrictive access modifier&lt;br /&gt;    Must not throw new or broader checked exceptions&lt;br /&gt;    May throw fewer or narrower checked exceptions, or any unchecked exception.&lt;br /&gt; final methods cannot be overridden.&lt;br /&gt; Only inherited methods may be overridden, and remember that private methods are not inherited.&lt;br /&gt; A subclass uses super.overriddenMethodName() to call the superclass version of an overridden method.&lt;br /&gt;&lt;br /&gt; Overloading means reusing amethod name, but with different arguments.&lt;br /&gt; Overloaded methods&lt;br /&gt;     Must have different argument lists&lt;br /&gt;     May have different return types, if argument lists are also different&lt;br /&gt;     May have different access modifiers&lt;br /&gt;     May throw different exceptions&lt;br /&gt; Methods from a superclass can be overloaded in a subclass.&lt;br /&gt; Polymorphism applies to overriding, not to overloading&lt;br /&gt; Object type (not the reference variable's type), determines which overridden method is used at runtime.&lt;br /&gt; Reference type determines which overloaded method will be used at compile time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-369664270646265838?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/369664270646265838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=369664270646265838' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/369664270646265838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/369664270646265838'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/overriding-and-overloading-overloading.html' title='Overriding and Overloading, Overloading, Overriding'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-321402757236168370</id><published>2009-08-20T23:30:00.001-07:00</published><updated>2009-08-20T23:30:33.583-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Polymorphism'/><title type='text'>Polymorphism</title><content type='html'>A reference variable is always of a single, unchangeable type, but it can refer to a subtype object.&lt;br /&gt; A single object can be referred to by reference variables of many different types— as long as they are the same type or a supertype of the object.&lt;br /&gt; The reference variable's type (not the object's type), determines which methods can be called!&lt;br /&gt; Polymorphic method invocations apply only to overridden instance methods.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-321402757236168370?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/321402757236168370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=321402757236168370' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/321402757236168370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/321402757236168370'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/polymorphism.html' title='Polymorphism'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-4288797954447656134</id><published>2009-08-20T23:28:00.002-07:00</published><updated>2009-08-20T23:29:38.739-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inheritance'/><title type='text'>Inheritance</title><content type='html'>Inheritance is a mechanism that allows a class to be a subclass of a superclass,and thereby inherit variables and methods of the superclass.&lt;br /&gt; Inheritance is a key concept that underlies IS-A, polymorphism, overriding, overloading, and casting.&lt;br /&gt; All classes (except class Object), are subclasses of type Object, and therefore they inherit Object's methods.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-4288797954447656134?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/4288797954447656134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=4288797954447656134' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/4288797954447656134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/4288797954447656134'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/inheritance_20.html' title='Inheritance'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-8966768298543132058</id><published>2009-08-20T23:28:00.001-07:00</published><updated>2009-08-20T23:28:55.056-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Encapsulation'/><category scheme='http://www.blogger.com/atom/ns#' term='IS-A'/><category scheme='http://www.blogger.com/atom/ns#' term='HAS-A'/><title type='text'>Encapsulation, IS-A, HAS-A</title><content type='html'>Encapsulation helps hide implementation behind an interface (or API).&lt;br /&gt; Encapsulated code has two features:&lt;br /&gt;     Instance variables are kept protected (usually with the private modifier).&lt;br /&gt;     Getter and setter methods provide access to instance variables.&lt;br /&gt; IS-A refers to inheritance.&lt;br /&gt; IS-A is expressed with the keyword extends.&lt;br /&gt; IS-A, "inherits from," and "is a subtype of" are all equivalent expressions.&lt;br /&gt; HAS-A means an instance of one class "has a" reference to an instance of another class.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-8966768298543132058?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/8966768298543132058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=8966768298543132058' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8966768298543132058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8966768298543132058'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/encapsulation-is-has.html' title='Encapsulation, IS-A, HAS-A'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-8232883140886542679</id><published>2009-08-20T04:19:00.000-07:00</published><updated>2009-08-20T05:20:43.040-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Identifiers'/><category scheme='http://www.blogger.com/atom/ns#' term='Declaration Rules'/><category scheme='http://www.blogger.com/atom/ns#' term='Declarations and Access Control'/><title type='text'>Declarations and Access Control</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Identifiers &lt;/span&gt;&lt;br /&gt;Identifiers can begin with a letter, an underscore, or a currency character.&lt;br /&gt;After the first character, identifiers can also include digits.&lt;br /&gt;Identifiers can be of any length.&lt;br /&gt;JavaBeans methods must be named using camelCase, and depending on the method's purpose, must start with set, get, is, add, or remove.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Declaration Rules &lt;/span&gt;&lt;br /&gt;A source code file can have only one public class.&lt;br /&gt;If the source file contains a public class, the filename must match the public class name.&lt;br /&gt;A file can have only one package statement, but multiple imports.&lt;br /&gt;The package statement (if any) must be the first (non-comment) line in a source file.&lt;br /&gt;The import statements (if any) must come after the package and before the class declaration.&lt;br /&gt;If there is no package statement, import statements must be the first (noncomment) statements in the source file, package and import statements apply to all classes in the file.&lt;br /&gt;A file can have more than one nonpublic class.&lt;br /&gt;Files with no public classes have no naming restrictions.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; Class Access Modifiers &lt;/span&gt;&lt;br /&gt;There are three access modifiers: public, protected, and private.&lt;br /&gt;There are four access levels: public, protected, default, and private.&lt;br /&gt;Classes can have only public or default access.&lt;br /&gt;A class with default access can be seen only by classes within the same package.&lt;br /&gt;A class with public access can be seen by all classes from all packages.&lt;br /&gt;Class visibility revolves around whether code in one class can&lt;br /&gt;      Create an instance of another class&lt;br /&gt;      Extend (or subclass), another class&lt;br /&gt;      Access methods and variables of another class&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Class Modifiers (Nonaccess)&lt;/span&gt;&lt;br /&gt;Classes can also be modified with final, abstract, or strictfp.&lt;br /&gt;A class cannot be both final and abstract.&lt;br /&gt;A final class cannot be subclassed.&lt;br /&gt;An abstract class cannot be instantiated.&lt;br /&gt;A single abstract method in a class means the whole class must be abstract.&lt;br /&gt;An abstract class can have both abstract and nonabstract methods.&lt;br /&gt;The first concrete class to extend an abstract class must implement all of its abstract methods.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Interface Implementation &lt;/span&gt;&lt;br /&gt;Interfaces are contracts for what a class can do, but they say nothing about&lt;br /&gt;the way in which the class must do it.&lt;br /&gt;Interfaces can be implemented by any class, from any inheritance tree.&lt;br /&gt;An interface is like a 100-percent abstract class, and is implicitly abstract whether you type the abstract modifier in the declaration or not.&lt;br /&gt;An interface can have only abstract methods, no concrete methods allowed.&lt;br /&gt;Interface methods are by default public and abstract—explicit declaration of these modifiers is optional.&lt;br /&gt;Interfaces can have constants, which are always implicitly public,static, and final.&lt;br /&gt;Interface constant declarations of public, static, and final are optional in any combination.&lt;br /&gt;A legal nonabstract implementing class has the following properties:&lt;br /&gt;   It provides concrete implementations for the interface's methods.&lt;br /&gt;   It must follow all legal override rules for the methods it implements.&lt;br /&gt;   It must not declare any new checked exceptions for an implementation method.&lt;br /&gt;   It must not declare any checked exceptions that are broader than the exceptions declared in the interface method.&lt;br /&gt;It may declare runtime exceptions on any interface method implementation regardless of the interface declaration.&lt;br /&gt;   It must maintain the exact signature (allowing for covariant returns)&lt;br /&gt;and return type of the methods it implements (but does not have to declare the exceptions of the interface).&lt;br /&gt;A class implementing an interface can itself be abstract.&lt;br /&gt;An abstract implementing class does not have to implement the interface methods (but the first concrete subclass must).&lt;br /&gt;A class can extend only one class (no multiple inheritance), but it can implement many interfaces.&lt;br /&gt;Interfaces can extend one or more other interfaces.&lt;br /&gt;Interfaces cannot extend a class, or implement a class or interface.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Member Access Modifiers &lt;/span&gt;&lt;br /&gt;Methods and instance (nonlocal) variables are known as "members."&lt;br /&gt;Members can use all four access levels: public, protected, default, private.&lt;br /&gt;Member access comes in two forms:&lt;br /&gt;   Code in one class can access a member of another class.&lt;br /&gt;   A subclass can inherit a member of its superclass.&lt;br /&gt;If a class cannot be accessed, its members cannot be accessed.&lt;br /&gt;Determine class visibility before determining member visibility.&lt;br /&gt;public members can be accessed by all other classes, even in other packages.&lt;br /&gt;If a superclass member is public, the subclass inherits it—regardless of package.&lt;br /&gt;Members accessed without the dot operator (.) must belong to the same class.&lt;br /&gt;this. always refers to the currently executing object.&lt;br /&gt;this.aMethod() is the same as just invoking aMethod().&lt;br /&gt;private members can be accessed only by code in the same class.&lt;br /&gt;private members are not visible to subclasses, so private members cannot be inherited.&lt;br /&gt;Default and protected members differ only when subclasses are involved:&lt;br /&gt;   Default members can be accessed only by classes in the same package.&lt;br /&gt;   protected members can be accessed by other classes in the same package, plus subclasses regardless of package.&lt;br /&gt;   protected = package plus kids (kids meaning subclasses).&lt;br /&gt;For subclasses outside the package, the protected member can be accessed only through inheritance; a subclass outside the package cannot&lt;br /&gt;access a protected member by using a reference to a superclass instance (in other words, inheritance is the only mechanism for a subclass&lt;br /&gt;outside the package to access a protected member of its superclass).&lt;br /&gt;A protected member inherited by a subclass from another package is not accessible to any other class in the subclass package, except for the&lt;br /&gt;subclass' own subclasses.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Local Variables&lt;/span&gt;&lt;br /&gt;Local (method, automatic, or stack) variable declarations cannot have access modifiers.&lt;br /&gt;final is the only modifier available to local variables.&lt;br /&gt;Local variables don't get default values, so they must be initialized before use.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Other Modifiers—Members&lt;/span&gt;&lt;br /&gt;final methods cannot be overridden in a subclass.&lt;br /&gt;abstract methods are declared, with a signature, a return type, and an optional throws clause, but are not implemented.&lt;br /&gt;abstract methods end in a semicolon—no curly braces.&lt;br /&gt;Three ways to spot a non-abstract method:&lt;br /&gt;    The method is not marked abstract.&lt;br /&gt;    The method has curly braces.&lt;br /&gt;    The method has code between the curly braces.&lt;br /&gt;The first nonabstract (concrete) class to extend an abstract class must implement all of the abstract class' abstract methods.&lt;br /&gt;The synchronized modifier applies only to methods and code blocks.&lt;br /&gt;synchronized methods can have any access control and can also be marked final.&lt;br /&gt;abstract methods must be implemented by a subclass, so they must be inheritable. For that reason:&lt;br /&gt;    abstract methods cannot be private.&lt;br /&gt;    abstract methods cannot be final.&lt;br /&gt;The native modifier applies only to methods.&lt;br /&gt;The strictfp modifier applies only to classes and methods.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Methods with var-args&lt;/span&gt;&lt;br /&gt;As of Java 5, methods can declare a parameter that accepts from zero to many arguments, a so-called var-arg method.&lt;br /&gt;A var-arg parameter is declared with the syntax type... name; for instance:&lt;br /&gt;doStuff(int... x) { }&lt;br /&gt;A var-arg method can have only one var-arg parameter.&lt;br /&gt;In methods with normal parameters and a var-arg, the var-arg must come last.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; Variable Declarations &lt;/span&gt;&lt;br /&gt;Instance variables can&lt;br /&gt;    Have any access control&lt;br /&gt;    Be marked final or transient&lt;br /&gt;Instance variables can't be abstract, synchronized, native, or strictfp.&lt;br /&gt;It is legal to declare a local variable with the same name as an instance variable; this is called "shadowing."&lt;br /&gt;final variables have the following properties:&lt;br /&gt;    final variables cannot be reinitialized once assigned a value.&lt;br /&gt;    final reference variables cannot refer to a different object once the object has been assigned to the final variable.&lt;br /&gt;    final reference variables must be initialized before the constructor completes.&lt;br /&gt;There is no such thing as a final object. An object reference marked final does not mean the object itself is immutable.&lt;br /&gt;The transient modifier applies only to instance variables.&lt;br /&gt;The volatile modifier applies only to instance variables.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; Array Declarations &lt;/span&gt;&lt;br /&gt;Arrays can hold primitives or objects, but the array itself is always an object.&lt;br /&gt;When you declare an array, the brackets can be to the left or right of the variable name.&lt;br /&gt;It is never legal to include the size of an array in the declaration.&lt;br /&gt;An array of objects can hold any object that passes the IS-A (or instanceof)&lt;br /&gt;test for the declared type of the array. For example, if Horse extends Animal, then a Horse object can go into an Animal array.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Static Variables and Methods &lt;/span&gt;&lt;br /&gt;They are not tied to any particular instance of a class.&lt;br /&gt;No classes instances are needed in order to use static members of the class.&lt;br /&gt;There is only one copy of a static variable / class and all instances share it.&lt;br /&gt;static methods do not have direct access to non-static members.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Enums&lt;/span&gt;&lt;br /&gt;An enum specifies a list of constant values that can be assigned to a&lt;br /&gt;particular type.&lt;br /&gt;An enum is NOT a String or an int; an enum constant's type is the enum&lt;br /&gt;type. For example, WINTER, SPRING, SUMMER, and FALL are of the&lt;br /&gt;enum type Season.&lt;br /&gt;An enum can be declared outside or inside a class, but NOT in a method.&lt;br /&gt;An enum declared outside a class must NOT be marked static, final,abstract, protected, or private.&lt;br /&gt;Enums can contain constructors, methods, variables, and constant class bodies.&lt;br /&gt;enum constants can send arguments to the enum constructor, using the syntax BIG(8), where the int literal 8 is passed to the enum constructor.&lt;br /&gt;enum constructors can have arguments, and can be overloaded.&lt;br /&gt;enum constructors can NEVER be invoked directly in code. They are always called automatically when an enum is initialized.&lt;br /&gt;The semicolon at the end of an enum declaration is optional. These are legal:&lt;br /&gt;   enum Foo { ONE, TWO, THREE}&lt;br /&gt;   enum Foo { ONE, TWO, THREE};&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-8232883140886542679?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/8232883140886542679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=8232883140886542679' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8232883140886542679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8232883140886542679'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/declarations-and-access-control.html' title='Declarations and Access Control'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-8086840698051582952</id><published>2009-08-20T04:11:00.000-07:00</published><updated>2009-08-20T04:12:32.435-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Basic jar tool commands'/><title type='text'>Basic jar tool commands</title><content type='html'>To create a JAR jar -cf MyJar.jar MyClass.class&lt;br /&gt;&lt;br /&gt;To extract the contents of a JAR jar -xf MyJar.jar&lt;br /&gt;&lt;br /&gt;To view the contents of a JAR jar -tf MyJar.jar&lt;br /&gt;&lt;br /&gt;To create a JAR with your own manifest jar -cmf myManifest.mf MyJar.jar MyClass.class&lt;br /&gt;&lt;br /&gt;To create a JAR that contains all files within a directory&lt;br /&gt;jar -cf MyJar.jar suncertify/db&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-8086840698051582952?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/8086840698051582952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=8086840698051582952' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8086840698051582952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8086840698051582952'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/basic-jar-tool-commands.html' title='Basic jar tool commands'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-7585951573920519462</id><published>2009-08-20T04:08:00.000-07:00</published><updated>2009-08-20T04:09:41.500-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='static variable'/><title type='text'>static variable</title><content type='html'>Also called a class variable. A static variable, much like a static&lt;br /&gt;method, may be accessed from a class directly, even though the class has not been&lt;br /&gt;instantiated. The value of a static variable will be the same in every instance of the&lt;br /&gt;class.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-7585951573920519462?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/7585951573920519462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=7585951573920519462' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7585951573920519462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7585951573920519462'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/static-variable.html' title='static variable'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-4048993602723270082</id><published>2009-08-20T04:02:00.001-07:00</published><updated>2009-08-20T04:02:48.700-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='static methods'/><title type='text'>static methods</title><content type='html'>The static keyword declares a method that belongs to an entire class (as opposed to belonging to an instance). A class method may be accessed directly from a class, without instantiating the class first&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-4048993602723270082?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/4048993602723270082/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=4048993602723270082' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/4048993602723270082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/4048993602723270082'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/static-methods.html' title='static methods'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-2022472619082745284</id><published>2009-08-20T04:01:00.001-07:00</published><updated>2009-08-20T04:01:58.501-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='static nested classes'/><title type='text'>static nested classes</title><content type='html'>Static nested classes are the simplest form of inner classes.&lt;br /&gt;They behave much like top-level classes except that they are defined within the scope&lt;br /&gt;of another class, namely the enclosing class. Static nested classes have no implicit&lt;br /&gt;references to instances of the enclosing class and can access only static members and&lt;br /&gt;methods of the enclosing class. Static nested classes are often used to implement&lt;br /&gt;small helper classes such as iterators&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-2022472619082745284?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/2022472619082745284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=2022472619082745284' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/2022472619082745284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/2022472619082745284'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/static-nested-classes.html' title='static nested classes'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-7490992657064519087</id><published>2009-08-20T04:00:00.000-07:00</published><updated>2009-08-20T04:01:18.860-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SortedMap'/><title type='text'>SortedMap</title><content type='html'>A data structure that is similar to map except the objects are stored in ascending order according to their keys. Like map, there can be no duplicate keys and the objects themselves may be duplicated. One very important difference with SortedMap objects is that the key may not be a null value&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-7490992657064519087?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/7490992657064519087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=7490992657064519087' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7490992657064519087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7490992657064519087'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/sortedmap.html' title='SortedMap'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-5939443368175735020</id><published>2009-08-20T03:59:00.000-07:00</published><updated>2009-08-20T04:00:16.468-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Runtime exceptions'/><title type='text'>Runtime exceptions</title><content type='html'>A runtime exception is an exception that does not need to be handled in your program. Usually, runtime exceptions indicate a program bug. These are referred to as unchecked exceptions, since the Java compiler does not force the program to handle them&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-5939443368175735020?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/5939443368175735020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=5939443368175735020' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5939443368175735020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5939443368175735020'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/runtime-exceptions.html' title='Runtime exceptions'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-6493970812149927312</id><published>2009-08-20T03:58:00.002-07:00</published><updated>2009-08-20T03:59:08.677-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Overridden methods'/><title type='text'>Overridden methods</title><content type='html'>Methods in the parent and subclasses with the same name, parameter list, and return type are overridden&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-6493970812149927312?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/6493970812149927312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=6493970812149927312' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/6493970812149927312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/6493970812149927312'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/overridden-methods.html' title='Overridden methods'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-7780200480264742656</id><published>2009-08-20T03:58:00.001-07:00</published><updated>2009-08-20T03:58:33.766-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Overloaded methods'/><title type='text'>Overloaded methods</title><content type='html'>Methods are overloaded when there are multiple methods in the same class with the same names but with different parameter lists&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-7780200480264742656?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/7780200480264742656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=7780200480264742656' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7780200480264742656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7780200480264742656'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/overloaded-methods.html' title='Overloaded methods'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-5813318260777050157</id><published>2009-08-20T03:57:00.000-07:00</published><updated>2009-08-20T03:58:05.950-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='notify()'/><category scheme='http://www.blogger.com/atom/ns#' term='notify() method'/><title type='text'>notify() method</title><content type='html'>The methods wait() and notify() are instance methods of an object. In the same way that every object has a lock, every object has a list of threads that are waiting for a signal related to the object. A thread gets on this list by executing the wait() method of the object. From that moment, it does not execute any further instructions until some other thread calls the notify() method of the same object.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-5813318260777050157?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/5813318260777050157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=5813318260777050157' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5813318260777050157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5813318260777050157'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/notify-method.html' title='notify() method'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-2644097608146831755</id><published>2009-08-20T03:56:00.000-07:00</published><updated>2009-08-20T03:57:08.473-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Local variable'/><title type='text'>Local variable</title><content type='html'>A local variable is a variable declared within a method. These are also known as automatic variables. Local variables, including primitives, must be initialized before you attempt to use them (though not necessarily on the same line of code).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-2644097608146831755?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/2644097608146831755/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=2644097608146831755' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/2644097608146831755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/2644097608146831755'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/local-variable.html' title='Local variable'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-7946037768556579387</id><published>2009-08-20T03:55:00.002-07:00</published><updated>2009-08-20T03:56:28.603-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Local inner classes'/><title type='text'>Local inner classes</title><content type='html'>You can define inner classes within the scope of a method, or even smaller blocks within a method. We call this a local inner class, and they are often also anonymous classes. Local inner classes cannot use local variables of the method unless those variables are marked final&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-7946037768556579387?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/7946037768556579387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=7946037768556579387' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7946037768556579387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7946037768556579387'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/local-inner-classes.html' title='Local inner classes'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-3416400338947295311</id><published>2009-08-20T03:55:00.001-07:00</published><updated>2009-08-20T03:55:43.516-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java.lang package'/><title type='text'>java.lang package</title><content type='html'>The java.lang package defines classes used by all Java programs. The package defines class wrappers for all primitive types such as Boolean,  Byte, Character, Double, Float, Integer, Long, and Short, as well as String, Thread, and Object. Unlike classes in any other package, classes in the java.lang package may be referred to by just their class name, without having to use an import statement&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-3416400338947295311?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/3416400338947295311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=3416400338947295311' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/3416400338947295311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/3416400338947295311'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/javalang-package.html' title='java.lang package'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-2679785983421980922</id><published>2009-08-20T03:54:00.000-07:00</published><updated>2009-08-20T03:55:03.142-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Virtual Machine (JVM)'/><title type='text'>Java Virtual Machine (JVM)</title><content type='html'>A program that interprets and executes Java bytecode (in most cases, the bytecode that was generated by a Java compiler). The Java VM provides a variety of resources to the applications it is executing, including memory management, network access, hardware abstraction, and so on. Because it provides a consistent environment for Java applications to run in, the Java VM is&lt;br /&gt;the heart of the “write once run anywhere” strategy that has made Java so popular&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-2679785983421980922?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/2679785983421980922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=2679785983421980922' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/2679785983421980922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/2679785983421980922'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/java-virtual-machine-jvm.html' title='Java Virtual Machine (JVM)'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-4462910868623729855</id><published>2009-08-20T03:52:00.000-07:00</published><updated>2009-08-20T03:54:05.204-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Iterator'/><title type='text'>Iterator</title><content type='html'>An iterator provides the necessary behavior to get to each element in a collection without exposing the collection itself. In classes containing and manipulating collections, it is good practice to return an iterator instead of the collection containing the elements you want to iterate over. This shields clients from internal changes to the data structures used in your classes&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-4462910868623729855?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/4462910868623729855/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=4462910868623729855' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/4462910868623729855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/4462910868623729855'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/iterator.html' title='Iterator'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-6610836570089121090</id><published>2009-08-20T03:51:00.002-07:00</published><updated>2009-08-20T03:52:25.574-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Interface'/><title type='text'>Interface</title><content type='html'>An interface defines a group of methods, or a public interface, that must be implemented by any class that implements the interface. An interface allows an object to be treated as a type declared by the interface implemented&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-6610836570089121090?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/6610836570089121090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=6610836570089121090' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/6610836570089121090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/6610836570089121090'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/interface.html' title='Interface'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-5612027660027229674</id><published>2009-08-20T03:51:00.001-07:00</published><updated>2009-08-20T03:51:40.367-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='instanceof operator'/><title type='text'>instanceof operator</title><content type='html'>The instanceof comparison operator is available for object variables. The purpose of this operator is to determine whether an object is of a given class or interface type (or any of the subtypes of that type).&lt;br /&gt;This comparison may not be made on primitive types and will result in a compile-time&lt;br /&gt;error if it is attempted&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-5612027660027229674?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/5612027660027229674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=5612027660027229674' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5612027660027229674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5612027660027229674'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/instanceof-operator.html' title='instanceof operator'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-3002267089723993597</id><published>2009-08-20T03:32:00.000-07:00</published><updated>2009-08-20T03:35:04.178-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Instance variable'/><title type='text'>Instance variable</title><content type='html'>An instance variable is belongs to an individual object. Instance variables may be accessed from other methods in the class, or from methods in other classes (depending on the access control). Instance variables may not be  accessed from static methods, however, because a static method could be invoked when no instances of the class exist. Logically, if no instances exist, then the instance variable will also not exist, and it would be impossible to access the instance variable.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-3002267089723993597?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/3002267089723993597/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=3002267089723993597' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/3002267089723993597'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/3002267089723993597'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/instance-variable.html' title='Instance variable'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-416383358072771558</id><published>2009-08-20T03:31:00.001-07:00</published><updated>2009-08-20T03:31:53.422-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inner classes'/><title type='text'>Inner classes</title><content type='html'>Inner classes are a type of class and follow most of the same rules as a normal class. The main difference is an inner class is declared within the curly braces of a class or even within a method. Inner classes are also classes defined at a  scope smaller than a package. See also Anonymous inner classes; Local inner classes;&lt;br /&gt;Member inner classes. Static inner classes are not actually inner classes, but are considered top-level nested classes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-416383358072771558?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/416383358072771558/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=416383358072771558' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/416383358072771558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/416383358072771558'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/inner-classes.html' title='Inner classes'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-8237803085108256516</id><published>2009-08-20T03:30:00.000-07:00</published><updated>2009-08-20T03:31:00.026-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inheritance'/><title type='text'>Inheritance</title><content type='html'>Inheritance is an object-oriented concept that provides for the reuse and modification of an existing type in such a way that many types can be manipulated as a single type. In Java, inheritance is achieved with the extends keyword.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-8237803085108256516?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/8237803085108256516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=8237803085108256516' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8237803085108256516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8237803085108256516'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/inheritance.html' title='Inheritance'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-766943187491273739</id><published>2009-08-20T03:29:00.001-07:00</published><updated>2009-08-20T03:29:50.725-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Identifiers'/><title type='text'>Identifiers</title><content type='html'>Identifiers are names that we assign to classes, methods, and variables.&lt;br /&gt;Java is a case-sensitive language, which means identifiers must have consistent capitalization throughout. Identifiers can have letters and numbers, but a number may not begin the identifier name. Most symbols are not allowed, but the dollar sign ($) and underscore (_) symbols are valid. See also Reference variable&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-766943187491273739?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/766943187491273739/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=766943187491273739' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/766943187491273739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/766943187491273739'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/identifiers.html' title='Identifiers'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-5033290838420246085</id><published>2009-08-20T03:28:00.003-07:00</published><updated>2009-08-20T03:28:55.854-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Heap'/><title type='text'>Heap</title><content type='html'>Java manages memory in a structure called a heap. Every object that Java creates is allocated in the heap, which is created at the beginning of the application and managed automatically by Java&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-5033290838420246085?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/5033290838420246085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=5033290838420246085' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5033290838420246085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5033290838420246085'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/heap.html' title='Heap'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-3300583286437453192</id><published>2009-08-20T03:28:00.001-07:00</published><updated>2009-08-20T03:28:26.684-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HashMap class'/><title type='text'>HashMap class</title><content type='html'>The HashMap class is roughly equivalent to Hashtable, except that it is not synchronized and it permits null values (and one null key) to be stored&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-3300583286437453192?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/3300583286437453192/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=3300583286437453192' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/3300583286437453192'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/3300583286437453192'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/hashmap-class.html' title='HashMap class'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-2450635286053112239</id><published>2009-08-20T03:24:00.000-07:00</published><updated>2009-08-20T03:25:11.505-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Finalizer'/><title type='text'>Finalizer</title><content type='html'>Every class has a special method, called a finalizer, which is called before an object is reclaimed by the Java VM garbage collector. The JVM calls the finalizer for you as appropriate; you never call a finalizer directly. Think of the finalizer as a friendly warning from the virtual machine. Your finalizer should perform two tasks: performing whatever cleanup is appropriate to the object, and&lt;br /&gt;calling the superclass finalizer. Finalizers are not guaranteed to be called just because an object becomes eligible for garbage collection, or before a program shuts down,&lt;br /&gt;so you should not rely on them.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-2450635286053112239?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/2450635286053112239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=2450635286053112239' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/2450635286053112239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/2450635286053112239'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/finalizer.html' title='Finalizer'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-5991317279680784819</id><published>2009-08-20T03:23:00.000-07:00</published><updated>2009-08-20T03:24:13.630-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='final variables'/><title type='text'>final variables</title><content type='html'>The final keyword applied to a variable makes it impossible to reinitialize a variable once it has been assigned a value. For primitives, this means the value may not be altered once it is initialized. For objects, the data within the object may be modified, but the reference variable may not be changed to reference a different object or null.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-5991317279680784819?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/5991317279680784819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=5991317279680784819' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5991317279680784819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5991317279680784819'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/final-variables.html' title='final variables'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-1684382834756483960</id><published>2009-08-20T03:22:00.002-07:00</published><updated>2009-08-20T03:23:20.393-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='final method'/><title type='text'>final method</title><content type='html'>The final keyword applied to a method prevents the method from being overridden by a subclass&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-1684382834756483960?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/1684382834756483960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=1684382834756483960' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1684382834756483960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1684382834756483960'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/final-method.html' title='final method'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-599271226873092360</id><published>2009-08-20T03:22:00.001-07:00</published><updated>2009-08-20T03:22:44.758-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='final class'/><title type='text'>final class</title><content type='html'>The final keyword restricts a class from being extended by another class. If you try to extend a final class, the Java compiler will give an error&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-599271226873092360?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/599271226873092360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=599271226873092360' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/599271226873092360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/599271226873092360'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/final-class.html' title='final class'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-7112754416911793928</id><published>2009-08-20T03:21:00.002-07:00</published><updated>2009-08-20T03:22:15.988-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Extensibility'/><title type='text'>Extensibility</title><content type='html'>Extensibility is a term that describes a design or code that can easily be enhanced without being rewritten&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-7112754416911793928?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/7112754416911793928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=7112754416911793928' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7112754416911793928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7112754416911793928'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/extensibility.html' title='Extensibility'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-431782654948094007</id><published>2009-08-20T03:21:00.001-07:00</published><updated>2009-08-20T03:21:46.809-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Exception handling'/><title type='text'>Exception handling</title><content type='html'>Exception handling allows developers to easily detect errors without writing special code to test return values. Better, it lets us handle these errors in code that is nicely separated from the code that generated them and handle an entire class of errors with the same code, and it allows us to let a method defer handling its errors to a previously called method. Exception handling works by&lt;br /&gt;transferring execution of a program to an exception handler when an error, or exception, occurs&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-431782654948094007?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/431782654948094007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=431782654948094007' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/431782654948094007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/431782654948094007'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/exception-handling.html' title='Exception handling'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-23492820708778977</id><published>2009-08-20T03:19:00.000-07:00</published><updated>2009-08-20T03:20:14.257-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Exception'/><title type='text'>Exception</title><content type='html'>Exception has two common meanings in Java. First, an Exception is an object type. Second, an exception is shorthand for “exceptional condition,” which is an occurrence that alters the normal flow of an application&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-23492820708778977?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/23492820708778977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=23492820708778977' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/23492820708778977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/23492820708778977'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/exception.html' title='Exception'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-8452941465863951000</id><published>2009-08-20T03:17:00.001-07:00</published><updated>2009-08-20T03:17:35.086-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Encapsulation'/><title type='text'>Encapsulation</title><content type='html'>Encapsulation is the process of grouping methods and data&lt;br /&gt;together and hiding them behind a public interface. A class demonstrates good&lt;br /&gt;encapsulation by protecting variables with private or protected access, while&lt;br /&gt;providing more publicly accessible setter and/or getter methods&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-8452941465863951000?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/8452941465863951000/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=8452941465863951000' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8452941465863951000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8452941465863951000'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/encapsulation.html' title='Encapsulation'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-6641351155909781820</id><published>2009-08-20T03:16:00.001-07:00</published><updated>2009-08-20T03:16:46.410-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='do-while loop'/><title type='text'>do-while loop</title><content type='html'>The do-while loop is slightly different from the while statement in that the program execution cycle will always enter the body of a do-while at least once. It does adhere to the rule that you do not need brackets around the body if it contains only one statement&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-6641351155909781820?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/6641351155909781820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=6641351155909781820' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/6641351155909781820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/6641351155909781820'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/do-while-loop.html' title='do-while loop'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-7996797423350288547</id><published>2009-08-20T03:11:00.001-07:00</published><updated>2009-08-20T03:11:51.053-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Default access'/><title type='text'>Default access</title><content type='html'>A class with default access needs no modifier preceding it in the declaration. Default access allows other classes within the same package to have visibility to this class&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-7996797423350288547?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/7996797423350288547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=7996797423350288547' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7996797423350288547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7996797423350288547'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/default-access.html' title='Default access'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-2541394726727430582</id><published>2009-08-20T03:10:00.000-07:00</published><updated>2009-08-20T03:11:04.821-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Declaration'/><title type='text'>Declaration</title><content type='html'>A declaration is a statement that declares a class, interface, method, package, or variable in a source file. A declaration can also explicitly initialize a variable by giving it a value&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-2541394726727430582?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/2541394726727430582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=2541394726727430582' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/2541394726727430582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/2541394726727430582'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/declaration.html' title='Declaration'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-2989234314567622270</id><published>2009-08-20T02:57:00.000-07:00</published><updated>2009-08-20T03:03:15.588-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Continue Statement'/><title type='text'>Continue Statement</title><content type='html'>The continue statement causes the current iteration of the innermost loop to cease and the next iteration of the same loop to start if the condition of the loop is met. In the case of using a continue statement with a for loop, you need to consider the effects that the continue has on the loop iterator&lt;br /&gt;(the iteration expression will run immediately after the continue statement).&lt;br /&gt;&lt;br /&gt;Example: http://java.sun.com/docs/books/tutorial/java/nutsandbolts/branch.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-2989234314567622270?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/2989234314567622270/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=2989234314567622270' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/2989234314567622270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/2989234314567622270'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/continue-statement.html' title='Continue Statement'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-5367686105263916795</id><published>2009-08-20T02:55:00.000-07:00</published><updated>2009-08-20T02:56:31.052-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Constructor'/><title type='text'>Constructor</title><content type='html'>A method-like block of code that is called when the object is created (instantiated) Typically, constructors initialize data members and acquire whatever resources the object may require. It is the code that runs before the object can be referenced.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-5367686105263916795?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/5367686105263916795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=5367686105263916795' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5367686105263916795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5367686105263916795'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/constructor.html' title='Constructor'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-2117783279918331214</id><published>2009-08-20T02:54:00.000-07:00</published><updated>2009-08-20T02:55:24.985-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Collection framework'/><title type='text'>Collection framework</title><content type='html'>Three elements (interfaces, implementations, and algorithms) create what is known as the collection framework, and include Sets (which contain no duplicates), Lists (which can be accessed by an index position), and Maps (which can be accessed by a unique identifier)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-2117783279918331214?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/2117783279918331214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=2117783279918331214' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/2117783279918331214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/2117783279918331214'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/collection-framework.html' title='Collection framework'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-8570908201542628463</id><published>2009-08-20T02:53:00.002-07:00</published><updated>2009-08-20T02:54:28.956-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Collection Interface'/><title type='text'>Collection interface</title><content type='html'>The collection interface defines the public interface that is common to Set and List collection classes. Map classes (such as HashMap and Hashtable) do not implement Collection, but are still considered part of the collection framework.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-8570908201542628463?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/8570908201542628463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=8570908201542628463' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8570908201542628463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8570908201542628463'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/collection-interface.html' title='Collection interface'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-2689347786739195495</id><published>2009-08-20T02:53:00.001-07:00</published><updated>2009-08-20T02:53:48.706-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Collection'/><title type='text'>Collection</title><content type='html'>A collection is an object used to store other objects. Collections are also commonly referred to as containers. Two common examples of collections are HashMap and ArrayList&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-2689347786739195495?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/2689347786739195495/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=2689347786739195495' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/2689347786739195495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/2689347786739195495'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/collection.html' title='Collection'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-1443872939094383604</id><published>2009-08-20T02:52:00.001-07:00</published><updated>2009-08-20T02:52:40.722-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Class members'/><title type='text'>Class members</title><content type='html'>Class members are things that belong to a class including methods (static and nonstatic), variables (static and nonstatic), and nested classes (static and nonstatic). Class members can have any of the four access control levels (public, protected, default (package), and private).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-1443872939094383604?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/1443872939094383604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=1443872939094383604' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1443872939094383604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1443872939094383604'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/class-members.html' title='Class members'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-4980166913417932800</id><published>2009-08-20T02:44:00.000-07:00</published><updated>2009-08-20T02:51:47.892-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Casting'/><title type='text'>Casting</title><content type='html'>Casting is the conversion of one type to another type. Typically, casting is used to convert an object reference to either a subtype (for example, casting an Animal reference to a Horse), but casting can also be used on primitive types to convert a larger type to a smaller type, such as from a long to an int.&lt;br /&gt;&lt;br /&gt;example:&lt;br /&gt;&lt;pre&gt;int i = 5;&lt;br /&gt;short s = (short)i;&lt;br /&gt;&lt;br /&gt;------------&lt;br /&gt;We create a superclass called Shape, with a number of subclasses (e.g.&lt;br /&gt;Circle, Square, Triangle, etc).&lt;br /&gt;&lt;/pre&gt; These classes can be treated as types; you can create instances and store their references in variables, e.g.: &lt;table width="70%" border="0" cellpadding="6"&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td class="code" valign="center"&gt; &lt;pre&gt;Shape shape = new Shape();&lt;br /&gt;Circle circle = new Circle();&lt;br /&gt;&lt;/pre&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; However, that's not the end of the story when you use inheritance. You could also do something like this:   &lt;br /&gt;Shape shape = new Circle(); &lt;pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-4980166913417932800?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/4980166913417932800/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=4980166913417932800' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/4980166913417932800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/4980166913417932800'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/casting.html' title='Casting'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-5664168016802978837</id><published>2009-08-20T02:43:00.001-07:00</published><updated>2009-08-20T02:43:37.333-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Blocked state'/><category scheme='http://www.blogger.com/atom/ns#' term='Threads'/><title type='text'>Blocked state</title><content type='html'>A thread that is waiting for a resource, such as a lock, to become available is said to be in a blocked state. Blocked threads consume no processor resources.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-5664168016802978837?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/5664168016802978837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=5664168016802978837' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5664168016802978837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5664168016802978837'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/blocked-state.html' title='Blocked state'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-8753268761845661323</id><published>2009-08-20T02:42:00.001-07:00</published><updated>2009-08-20T02:42:47.757-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Automatic variables'/><title type='text'>Automatic variables</title><content type='html'>Also called method local or stack variables. Automatic variables are variables that are declared within a method and discarded when the method has completed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-8753268761845661323?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/8753268761845661323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=8753268761845661323' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8753268761845661323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8753268761845661323'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/automatic-variables.html' title='Automatic variables'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-4147494235272111650</id><published>2009-08-20T02:41:00.000-07:00</published><updated>2009-08-20T02:42:17.661-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Array'/><title type='text'>Array</title><content type='html'>Arrays are homogeneous data structures implemented in Java as objects. Arrays store one or more of a specific type and provide indexed access to the store&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-4147494235272111650?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/4147494235272111650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=4147494235272111650' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/4147494235272111650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/4147494235272111650'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/array.html' title='Array'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-1920651001866665247</id><published>2009-08-20T02:37:00.000-07:00</published><updated>2009-08-20T02:41:17.856-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Anonymous inner classes'/><title type='text'>Anonymous inner classes</title><content type='html'>Anonymous inner classes are local inner classes that do not have a class name. You create an anonymous inner class by creating an instance of a new unnamed class that is either a subclass of a named class type or an implementer of a named interface type.&lt;br /&gt;&lt;br /&gt;Example of inner classes:&lt;br /&gt;http://java.sun.com/docs/books/tutorial/java/javaOO/innerclasses.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-1920651001866665247?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/1920651001866665247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=1920651001866665247' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1920651001866665247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1920651001866665247'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/anonymous-inner-classes.html' title='Anonymous inner classes'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-4095845003004268699</id><published>2009-08-20T02:33:00.000-07:00</published><updated>2009-08-20T02:34:05.748-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Can a abstract class have a constructor ?'/><category scheme='http://www.blogger.com/atom/ns#' term='When would the constructor in the abstract class be called ?'/><title type='text'>Can a abstract class have a constructor ?When would the constructor in the abstract class be called ?</title><content type='html'>&lt;span class="tdvamseel"&gt;All the classes including the abstract classes can have constructors.Abstract class constructors will be called when its concrete subclass will be instantiated.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-4095845003004268699?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/4095845003004268699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=4095845003004268699' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/4095845003004268699'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/4095845003004268699'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/can-abstract-class-have-constructor.html' title='Can a abstract class have a constructor ?When would the constructor in the abstract class be called ?'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-8239132740269893568</id><published>2009-08-20T02:32:00.001-07:00</published><updated>2009-08-20T02:32:37.492-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Abstract method'/><title type='text'>Abstract method</title><content type='html'>An abstract method is a method declaration that contains no functional code. The reason for using an abstract method is to ensure that subclasses of this class will include an implementation of this method. Any concrete class (that is, a class that is not abstract, and therefore capable of being instantiated) must implement all abstract methods it has inherited&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-8239132740269893568?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/8239132740269893568/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=8239132740269893568' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8239132740269893568'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/8239132740269893568'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/abstract-method.html' title='Abstract method'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-6730990751391645573</id><published>2009-08-20T02:31:00.001-07:00</published><updated>2009-08-20T02:31:51.985-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Abstract class'/><title type='text'>Abstract class</title><content type='html'>An abstract class is a type of class that is not allowed to be instantiated. The only reason it exists is to be extended. Abstract classes contain methods and variables common to all the subclasses, but the abstract class itself is of a type that will not be used directly. Even a single abstract method requires that a class be marked abstract&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-6730990751391645573?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/6730990751391645573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=6730990751391645573' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/6730990751391645573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/6730990751391645573'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/abstract-class.html' title='Abstract class'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-7870859187194237374</id><published>2009-08-20T02:28:00.000-07:00</published><updated>2009-08-20T02:29:46.407-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Superclass'/><title type='text'>Superclass</title><content type='html'>In object technology, a high-level class that passes attributes and methods (data and processing) down the hierarchy to subclasses. A superclass is a class from which one or more other classes are derived.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-7870859187194237374?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/7870859187194237374/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=7870859187194237374' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7870859187194237374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/7870859187194237374'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/superclass.html' title='Superclass'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-2970118422113695404</id><published>2009-08-20T02:27:00.000-07:00</published><updated>2009-08-20T02:28:47.192-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Switch Statement'/><title type='text'>Switch Statement</title><content type='html'>The expression in the switch statement can only evaluate to an integral primitive type that can be implicitly cast to an int. These types are byte, short, char, and int. Also, the switch can only check for an equality. This means that the other relational operators like the greater than sign are rendered unusable.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-2970118422113695404?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/2970118422113695404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=2970118422113695404' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/2970118422113695404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/2970118422113695404'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/switch-statement.html' title='Switch Statement'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-1301762424852351447</id><published>2009-08-20T02:26:00.000-07:00</published><updated>2009-08-20T02:27:06.320-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Synchronized methods'/><title type='text'>Synchronized methods</title><content type='html'>Synchronized methods The synchronized keyword indicates that a method may be accessed by only one thread at a time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-1301762424852351447?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/1301762424852351447/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=1301762424852351447' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1301762424852351447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1301762424852351447'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/synchronized-methods.html' title='Synchronized methods'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-761280784008622296</id><published>2009-08-20T02:25:00.002-07:00</published><updated>2009-08-20T02:26:35.991-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Transient Keyword'/><title type='text'>Transient Keyword</title><content type='html'>The transient keyword indicates which variables are not to have their data written to an ObjectStream.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-761280784008622296?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/761280784008622296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=761280784008622296' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/761280784008622296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/761280784008622296'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/transient-keyword.html' title='Transient Keyword'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-5268967120195805599</id><published>2009-08-20T02:25:00.001-07:00</published><updated>2009-08-20T02:25:38.149-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visibility'/><title type='text'>Visibility</title><content type='html'>Visibility is the accessibility of methods and instance variables to other classes and packages. When implementing a class, you determine your methods’ and instance variables’ visibility keywords as public, protected, package, or default.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-5268967120195805599?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/5268967120195805599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=5268967120195805599' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5268967120195805599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5268967120195805599'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/visibility.html' title='Visibility'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-5924014119227877830</id><published>2009-08-20T02:23:00.000-07:00</published><updated>2009-08-20T02:24:48.027-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Thread'/><title type='text'>Thread</title><content type='html'>An independent line of execution. The same method may be used in multiple threads. As a thread executes instructions, any variables that it declares within the method (the so-called automatic variables) are stored in a private area of memory, which other threads cannot access. This allows any other thread to execute the same method on the same object at the same time without having its automatic variables unexpectedly modified.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-5924014119227877830?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/5924014119227877830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=5924014119227877830' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5924014119227877830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5924014119227877830'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/thread.html' title='Thread'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-3715258219421939361</id><published>2009-08-18T05:27:00.000-07:00</published><updated>2009-08-18T05:29:36.839-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Map Iterator'/><title type='text'>Map Iterator</title><content type='html'>Iterator iterator = mapObject.entrySet() .iterator();&lt;br /&gt;        while (iterator.hasNext()) {&lt;br /&gt;&lt;br /&gt;            Map.Entry&lt;string,&gt;&gt; pairs = (Map.Entry&lt;string,&gt;&gt;) iterator&lt;br /&gt;                    .next();&lt;br /&gt;            String key = pairs.getKey();&lt;br /&gt;            List&lt;short&gt; = pairs.getValue();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-3715258219421939361?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/3715258219421939361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=3715258219421939361' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/3715258219421939361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/3715258219421939361'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/08/map-iterator.html' title='Map Iterator'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-5728415702506799550</id><published>2009-07-15T22:37:00.000-07:00</published><updated>2009-07-15T22:38:40.335-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ways to create a thread'/><title type='text'>Ways to create a thread</title><content type='html'>class FooRunnable implements Runnable {&lt;br /&gt;public void run() {&lt;br /&gt;for(int x =1; x &lt; 6; x++) {&lt;br /&gt;System.out.println("Runnable running");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;public class TestThreads {&lt;br /&gt;public static void main (String [] args) {&lt;br /&gt;FooRunnable r = new FooRunnable();&lt;br /&gt;Thread t = new Thread(r);&lt;br /&gt;t.start();&lt;br /&gt;}&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-5728415702506799550?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/5728415702506799550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=5728415702506799550' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5728415702506799550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/5728415702506799550'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/07/ways-to-create-thread.html' title='Ways to create a thread'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-6304140547796589020</id><published>2009-07-15T22:27:00.000-07:00</published><updated>2009-07-15T22:30:18.591-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Comparable Interface'/><category scheme='http://www.blogger.com/atom/ns#' term='How to use Comparable Interface'/><title type='text'>How to use Comparable Interface</title><content type='html'>Reference : http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Comparable.html&lt;br /&gt;This interface imposes a total ordering on the objects of each class that implements it. This ordering is referred to as the class's natural ordering, and the class's compareTo method is referred to as its natural comparison method.&lt;br /&gt;Lists (and arrays) of objects that implement this interface can be sorted automatically by Collections.sort (and Arrays.sort). Objects that implement this interface can be used as keys in a sorted map or elements in a sorted set, without the need to specify a comparator.&lt;br /&gt;&lt;br /&gt;Reference : http://www.java-tips.org/java-se-tips/java.lang/how-to-use-comparable-interface.html&lt;br /&gt;&lt;br /&gt;List of objects that implement this interface can be sorted automatically by sort method of the list interface. This interface has compareTo() method that is used by the sort() method of the list.&lt;br /&gt;&lt;br /&gt;In this code Employee class is implementing Comparable interface and have method compareTO(). ComparableDemo.java is showing the use of this interface. This class first makes a list of objects of type Employee and call sort method of java.util.Collections, which internally uses compareTo() method of Employee class and sort the list accordingly.&lt;br /&gt;&lt;br /&gt;Employee.java&lt;br /&gt;public class Employee implements Comparable {&lt;br /&gt;&lt;br /&gt;    int EmpID;&lt;br /&gt;    String Ename;&lt;br /&gt;    double Sal;&lt;br /&gt;    static int i;&lt;br /&gt;&lt;br /&gt;    public Employee() {&lt;br /&gt;        EmpID = i++;&lt;br /&gt;        Ename = "dont know";&lt;br /&gt;        Sal = 0.0;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public Employee(String ename, double sal) {&lt;br /&gt;        EmpID = i++;&lt;br /&gt;        Ename = ename;&lt;br /&gt;        Sal = sal;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public String toString() {&lt;br /&gt;        return "EmpID " + EmpID + "\n" + "Ename " + Ename + "\n" + "Sal" + Sal;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public int compareTo(Object o1) {&lt;br /&gt;        if (this.Sal == ((Employee) o1).Sal)&lt;br /&gt;            return 0;&lt;br /&gt;        else if ((this.Sal) &gt; ((Employee) o1).Sal)&lt;br /&gt;            return 1;&lt;br /&gt;        else&lt;br /&gt;            return -1;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ComparableDemo.java&lt;br /&gt;import java.util.*;&lt;br /&gt;&lt;br /&gt;public class ComparableDemo{&lt;br /&gt;&lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;&lt;br /&gt;        List ts1 = new ArrayList();&lt;br /&gt;        ts1.add(new Employee ("Tom",40000.00));&lt;br /&gt;        ts1.add(new Employee ("Harry",20000.00));&lt;br /&gt;        ts1.add(new Employee ("Maggie",50000.00));&lt;br /&gt;        ts1.add(new Employee ("Chris",70000.00));&lt;br /&gt;        Collections.sort(ts1);&lt;br /&gt;        Iterator itr = ts1.iterator();&lt;br /&gt;&lt;br /&gt;        while(itr.hasNext()){&lt;br /&gt;            Object element = itr.next();&lt;br /&gt;            System.out.println(element + "\n");&lt;br /&gt;           &lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-6304140547796589020?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/6304140547796589020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=6304140547796589020' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/6304140547796589020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/6304140547796589020'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/07/how-to-use-comparable-interface.html' title='How to use Comparable Interface'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-6533830422689371831</id><published>2009-07-15T22:17:00.000-07:00</published><updated>2009-07-15T22:19:26.150-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Synchronize arraylist'/><title type='text'>Synchronize arraylist</title><content type='html'>Method 1) ArrayList al=new ArrayList();&lt;br /&gt;al.add("1");&lt;br /&gt;al.add("1");&lt;br /&gt;al.add("2");&lt;br /&gt;//we can make the synchronized&lt;br /&gt;&lt;br /&gt;Collections.synchronized(al);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Method 2)&lt;br /&gt;List list = Collections.synchronizedList(new ArrayList(...));&lt;br /&gt;&lt;br /&gt;synchronized(list) {&lt;br /&gt;Iterator i = list.iterator(); // Must be in synchronized block&lt;br /&gt;while (i.hasNext())&lt;br /&gt;foo(i.next());&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-6533830422689371831?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/6533830422689371831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=6533830422689371831' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/6533830422689371831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/6533830422689371831'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/07/synchronize-arraylist.html' title='Synchronize arraylist'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-6292110662387573051</id><published>2009-07-15T22:10:00.001-07:00</published><updated>2009-07-15T22:10:27.209-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Collection'/><category scheme='http://www.blogger.com/atom/ns#' term='Collection Interface'/><title type='text'>Collection</title><content type='html'>public interface Collection&lt;e&gt;&lt;br /&gt;extends Iterable&lt;e&gt;&lt;br /&gt;&lt;br /&gt;A collection represents a group of objects, known as its elements. Some collections allow duplicate elements and others do not. Some are ordered and others unordered.Implementations of more specific sub interfaces like Set and List are provided. This interface is typically used to pass collections around and manipulate them where maximum generality is desired.&lt;br /&gt;Bags or multisets (unordered collections that may contain duplicate elements) should implement this interface directly.&lt;br /&gt;&lt;br /&gt;Many methods in Collections Framework interfaces are defined in terms of the equals method. For example, the specification for the contains(Object o) method says: "returns true if and only if this collection contains at least one element e such that (o==null ? e==null : o.equals(e))." This specification should not be construed to imply that invoking Collection.contains with a non-null argument o will cause o.equals(e) to be invoked for any element e. Implementations are free to implement optimizations whereby the equals invocation is avoided, for example, by first comparing the hash codes of the two elements. (The Object.hashCode() specification guarantees that two objects with unequal hash codes cannot be equal.) More generally, implementations of the various Collections Framework interfaces are free to take advantage of the specified behavior of underlying Object methods wherever the implementor deems it appropriate.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-6292110662387573051?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/6292110662387573051/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=6292110662387573051' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/6292110662387573051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/6292110662387573051'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/07/collection.html' title='Collection'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-4268781488137921067</id><published>2009-07-15T02:59:00.000-07:00</published><updated>2009-07-15T03:00:35.208-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EJB VS Hibernate'/><title type='text'>EJB VS Hibernate</title><content type='html'>The similarity is that with both you can persist a class in a DB.&lt;br /&gt;EJBs are supposed to be components, in the sense that they're not just one class, but a set of classes, descriptors (thats anXML and/or annotations in EJB 3) and usage and management contracts. All of this in order to allow a container (JBoss,Weblogic, etc.) to provide services to those components, and to be able to reuse and distribute this components.&lt;br /&gt;This&lt;br /&gt;services are, among others, transactions, concurrent access control, security, instance pooling, etcetera.&lt;br /&gt;Hibernat is "just" an ORM (Object/Relational Mapping) tool. Quick and dirty, this means you can store an object tree belonging to an class hierarchy in a relational DB without writing a single SQL query. Quite cool, IMO. But no transaction control, no instance pooling, no concurrency control, and certainly no security.&lt;br /&gt;It states that the EJB expert group has decided to use Hibernate as the persistence mechanism in EJB 3.0.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-4268781488137921067?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/4268781488137921067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=4268781488137921067' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/4268781488137921067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/4268781488137921067'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/07/ejb-vs-hibernate.html' title='EJB VS Hibernate'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-1221498390511322289</id><published>2009-07-15T02:38:00.001-07:00</published><updated>2009-07-15T02:39:39.807-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JMS Sample Code'/><title type='text'>JMS Sample Code</title><content type='html'>import java.util.Properties;&lt;br /&gt;import java.util.ResourceBundle;&lt;br /&gt;&lt;br /&gt;import javax.naming.*;&lt;br /&gt;import javax.jms.JMSException;&lt;br /&gt;import javax.jms.Queue;&lt;br /&gt;import javax.jms.Connection;&lt;br /&gt;import javax.jms.ConnectionFactory;&lt;br /&gt;import javax.jms.Session;&lt;br /&gt;import javax.jms.TextMessage;&lt;br /&gt;import javax.jms.Destination;&lt;br /&gt;import javax.jms.MessageProducer;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public class JMSClientJNDIImpl {&lt;br /&gt;   &lt;br /&gt;    private static ConnectionFactory connectionFactory = null;&lt;br /&gt;    private static Destination destination = null;&lt;br /&gt;   &lt;br /&gt;    protected JMSClientJNDIImpl() {&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * SingletonHolder is loaded on the first execution of&lt;br /&gt;     * Singleton.getInstance() or the first access to SingletonHolder.INSTANCE ,&lt;br /&gt;     * not before.&lt;br /&gt;     */&lt;br /&gt;&lt;br /&gt;    private static class SingletonHolder {&lt;br /&gt;       &lt;br /&gt;        private final static JMSClientJNDIImpl INSTANCE = new JMSClientJNDIImpl();&lt;br /&gt;       &lt;br /&gt;        static {&lt;br /&gt;            Context jndiContext = null;&lt;br /&gt;   &lt;br /&gt;           &lt;br /&gt;            try {&lt;br /&gt;               &lt;br /&gt;                jndiContext = new InitialContext();&lt;br /&gt;&lt;br /&gt;                /*&lt;br /&gt;                 * Look up connection factory and destination. If either does not exist, exit. &lt;br /&gt;                 * If you look up a TopicConnectionFactory or a QueueConnectionFactory,&lt;br /&gt;                 * program behavior is the same.&lt;br /&gt;                 */&lt;br /&gt;                String destinationName = getBundle().getString("jms.connection.factory");&lt;br /&gt;                connectionFactory = (ConnectionFactory) jndiContext.lookup("jms/MyConnectionFactory");&lt;br /&gt;                destination = (Destination) jndiContext.lookup(destinationName);&lt;br /&gt;               &lt;br /&gt;            } catch (NamingException e) {&lt;br /&gt;                e.printStackTrace();&lt;br /&gt;               &lt;br /&gt;            } catch (Exception e) {&lt;br /&gt;                e.printStackTrace();&lt;br /&gt;               &lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    //returns instance of JMSClientJNDIImpl&lt;br /&gt;    public static JMSClientJNDIImpl getInstance() {&lt;br /&gt;        return SingletonHolder.INSTANCE;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * @param transactionID&lt;br /&gt;     * @param workFlowID&lt;br /&gt;     * @param messageTitle&lt;br /&gt;     * @param timestamp&lt;br /&gt;     * @param transformFlag&lt;br /&gt;      */&lt;br /&gt;    public void transactionMessagesLogging(String transactionID,&lt;br /&gt;            String xmlData, String messageTitle, String timestamp,&lt;br /&gt;            Boolean transformFlag) throws Exception {&lt;br /&gt;        try {&lt;br /&gt;            StringBuffer loggingMessage = new StringBuffer();&lt;br /&gt;            createAndSendMessage(msg);&lt;br /&gt;&lt;br /&gt;        } catch (JMSException e) {&lt;br /&gt;           &lt;br /&gt;           &lt;br /&gt;        } catch (Exception e) {&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;           &lt;br /&gt;           &lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * this method uses the connection to create a session and messages to the queue&lt;br /&gt;     * @param transactionID&lt;br /&gt;     * @param xmlData&lt;br /&gt;     * @param messageTitle&lt;br /&gt;     * @param timestamp&lt;br /&gt;     * @param transformFlag&lt;br /&gt;     * @param loggingMessage&lt;br /&gt;     * @throws JMSException&lt;br /&gt;     * @throws Exception&lt;br /&gt;     */&lt;br /&gt;    private void createAndSendMessage(String msg) throws JMSException, Exception {&lt;br /&gt;&lt;br /&gt;        Connection connection = null;&lt;br /&gt;        MessageProducer producer = null;&lt;br /&gt;        Session session = null;&lt;br /&gt;       &lt;br /&gt;       &lt;br /&gt;        try {&lt;br /&gt;            /*&lt;br /&gt;             * Create connection.&lt;br /&gt;             * Create session from connection; false means session is&lt;br /&gt;             * not transacted.&lt;br /&gt;             * Create producer and text message.&lt;br /&gt;             * Send messages, varying text slightly.&lt;br /&gt;             * Send end-of-messages message.&lt;br /&gt;             * Finally, close connection.&lt;br /&gt;             */&lt;br /&gt;            connection = connectionFactory.createConnection();&lt;br /&gt;           &lt;br /&gt;            session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);&lt;br /&gt;            producer = session.createProducer(destination);&lt;br /&gt;           &lt;br /&gt;&lt;br /&gt;            //creating the text message&lt;br /&gt;            TextMessage transactionMessage = session.createTextMessage();&lt;br /&gt;            loggingMessage.append(msg.trim());&lt;br /&gt;            transactionMessage.setText(loggingMessage.toString());&lt;br /&gt;            producer.send(transactionMessage);&lt;br /&gt;           &lt;br /&gt;            /*&lt;br /&gt;             * Send a non-text control message indicating end of&lt;br /&gt;             * messages.&lt;br /&gt;             */&lt;br /&gt;            producer.send(session.createMessage());&lt;br /&gt;&lt;br /&gt;        } catch (JMSException e) {&lt;br /&gt;        e.printStackTrace();&lt;br /&gt;           &lt;br /&gt;           &lt;br /&gt;        } catch (Exception e) {&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;           &lt;br /&gt;           &lt;br /&gt;        } finally {&lt;br /&gt;            try {&lt;br /&gt;                // closing resources&lt;br /&gt;                if (session != null) {&lt;br /&gt;                    session.close();&lt;br /&gt;                }&lt;br /&gt;                if (connection != null) {&lt;br /&gt;                    connection.close();&lt;br /&gt;                }&lt;br /&gt;            } catch (Exception e) {&lt;br /&gt;               &lt;br /&gt;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;        //read values from properties file&lt;br /&gt;    private static ResourceBundle getBundle() throws Exception {&lt;br /&gt;        MessageReader reader = MessageReader.getInstance();&lt;br /&gt;        ResourceBundle bundle = reader.getReader("ApplicationResources");&lt;br /&gt;        return bundle;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-1221498390511322289?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/1221498390511322289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=1221498390511322289' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1221498390511322289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1221498390511322289'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/07/jms-sample-code.html' title='JMS Sample Code'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-775419127740422545</id><published>2009-07-15T02:26:00.000-07:00</published><updated>2009-07-15T02:28:50.646-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JMS Messaging'/><title type='text'>JMS Messaging</title><content type='html'>Messaging is a form of loosely coupled distributed communication, where in this context the term 'communication' can be understood as an exchange of messages between software components. Message-oriented technologies attempt to relax tightly coupled communication (such as TCP network sockets,  RMI) by the introduction of an intermediary component, which in this case would be a queue. The latter approach allows software components to communicate 'indirectly' with each other. Benefits of this include message senders not needing to have precise knowledge of their receivers, since communication is performed using this queue. This is the first of two types: point to point and publish and subscribe.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;JMS provider&lt;/span&gt;&lt;br /&gt;   An implementation of the JMS interface for a Message Oriented Middleware (MOM). Providers are implemented as either a Java JMS implementation or an adapter to a non-Java MOM.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;JMS client&lt;/span&gt;&lt;br /&gt;   An application or process that produces and/or receives messages.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;JMS producer&lt;/span&gt;&lt;br /&gt;   A JMS client that creates and sends messages.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;JMS consumer&lt;/span&gt;&lt;br /&gt;   A JMS client that receives messages.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;JMS message&lt;/span&gt;&lt;br /&gt;   An object that contains the data being transferred between JMS clients.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;JMS queue&lt;/span&gt;&lt;br /&gt;   A staging area that contains messages that have been sent and are waiting to be read. As the name queue suggests, the messages are delivered in the order sent. A message is removed from the queue once it has been read.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;JMS topic&lt;/span&gt;&lt;br /&gt;   A distribution mechanism for publishing messages that are delivered to multiple subscribers.&lt;br /&gt; &lt;br /&gt;The JMS API supports two models:&lt;br /&gt;   * point-to-point or queuing model&lt;br /&gt;   * publish and subscribe model&lt;br /&gt;&lt;br /&gt;In the point-to-point or queuing model, a sender posts messages to a particular queue and a receiver reads messages from the queue. Here, the sender knows the destination of the message and posts the message directly to the receiver's queue. It is characterized by the following:&lt;br /&gt;   * Only one consumer gets the message&lt;br /&gt;   * The producer does not have to be running at the time the consumer consumes the message, nor does the consumer need to be running at the time the message is sent&lt;br /&gt;   * Every message successfully processed is acknowledged by the consumer&lt;br /&gt;&lt;br /&gt;The publish/subscribe model supports publishing messages to a particular message topic. Subscribers may register interest in receiving messages on a particular message topic. In this model, neither the publisher nor the subscriber know about each other. A good metaphor for it is anonymous bulletin board. The following are characteristics of this model:&lt;br /&gt;   * Multiple consumers can get the message&lt;br /&gt;   * There is a timing dependency between publishers and subscribers. The publisher has to create a subscription in order for clients to be able to subscribe. The subscriber has to remain continuously active to receive messages, unless it has established a durable subscription. In that case, messages published while the subscriber is not connected will be redistributed whenever it reconnects.&lt;br /&gt;&lt;br /&gt;Using Java, JMS provides a way of separating the application from the transport layer of providing data. The same Java classes can be used to communicate with different JMS providers by using the JNDI information for the desired provider. The classes first use a connection factory to connect to the queue or topic, and then use populate and send or publish the messages. On the receiving side, the clients then receive or subscribe to the messages.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The JMS API is provided in the Java package &lt;span style="font-weight: bold;"&gt;javax.jms.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ConnectionFactory interface&lt;/span&gt;&lt;br /&gt;An administered object that a client uses to create a connection to the JMS provider. JMS clients access the connection factory through portable interfaces so the code does not need to be changed if the underlying implementation changes. Administrators configure the connection factory in the Java Naming and Directory Interface (JNDI) namespace so that JMS clients can look them up. In version 1.0, Depending on the type of message, users will use either a queue connection factory or topic connection factory. In JMS version 1.1 these factories are merged into a single factory.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; Connection interface&lt;/span&gt;&lt;br /&gt;Once a connection factory is obtained, a connection to a JMS provider can be created. A connection represents a communication link between the application and the messaging server. Depending on the connection type, connections allow users to create sessions for sending and receiving messages from a queue or topic.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Destination interface&lt;/span&gt;&lt;br /&gt;An administered object that encapsulates the identity of a message destination, which is where messages are delivered and consumed. It is either a queue or a topic. The JMS administrator creates these objects, and users discover them using JNDI. Like the connection factory, the administrator can create two types of destinations: queues for Point-to-Point and topics for Publish/Subscribe.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; MessageConsumer interface&lt;/span&gt;&lt;br /&gt;An object created by a session. It receives messages sent to a destination. The consumer can receive messages synchronously (blocking) or asynchronously (non-blocking) for both queue and topic-type messaging.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;MessageProducer interface&lt;/span&gt;&lt;br /&gt;An object created by a session that sends messages to a destination. The user can create a sender to a specific destination or create a generic sender that specifies the destination at the time the message is sent.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Message interface&lt;/span&gt;&lt;br /&gt;An object that is sent between consumers and producers; that is, from one application to another. A message has three main parts:&lt;br /&gt;&lt;br /&gt;  1. A message header (required): Contains operational settings to identify and route messages.&lt;br /&gt;  2. A set of message properties (optional): Contains additional properties to support compatibility with other providers or users. It can be used to create custom fields or filters (selectors).&lt;br /&gt;  3. A message body (optional): Allows users to create five types of messages (text message, map message, bytes message, stream message, and object message).&lt;br /&gt;&lt;br /&gt;The message interface is extremely flexible and provides numerous ways to customize the contents of a message..&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Session interface&lt;/span&gt;&lt;br /&gt;Represents a single-threaded context for sending and receiving messages. A session is single-threaded so that messages are serialized, meaning that messages are received one-by-one in the order sent. The benefit of a session is that it supports transactions. If the user selects transaction support, the session context holds a group of messages until the transaction is committed, then delivers the messages. Before committing the transaction, the user can cancel the messages using a rollback operation. A session allows users to create message producers to send messages, and message consumers to receive messages.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-775419127740422545?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/775419127740422545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=775419127740422545' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/775419127740422545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/775419127740422545'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/07/jms-messaging.html' title='JMS Messaging'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4873923668672596462.post-1386653476341139972</id><published>2009-07-15T02:16:00.001-07:00</published><updated>2009-07-15T02:16:53.265-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Synchronous Message'/><category scheme='http://www.blogger.com/atom/ns#' term='Synchronous vs Asynchronous'/><category scheme='http://www.blogger.com/atom/ns#' term='Asynchronous Message'/><title type='text'>Synchronous vs Asynchronous</title><content type='html'>Synchronous vs Asynchronous&lt;br /&gt;&lt;br /&gt;The send, receive, and reply operations may be synchronous or asynchronous. A synchronous operation blocks a process till the operation completes. An asynchronous operation is non-blocking and only initiates the operation. The caller could discover completion by some other mechanism.&lt;br /&gt;&lt;br /&gt;The notion of synchronous operations requires an understanding of what it means for an operation to complete. In the case of remote assignment, both the send and receive complete when the message has been delivered to the receiver. In the case of remote procedure call, the send, receive, and reply complete when the result has been delivered to the sender, assuming there is a return value. Otherwise, the send and receive complete when the procedure finishes execution.&lt;br /&gt;&lt;br /&gt;Asynchronous message passing allows more parallelism. Since a process does not block, it can do some computation while the message is in transit. In the case of receive, this means a process can express its interest in receving messages on multiple ports siumtaneously. In a synchronous system, such parallelism can be achieved by forking a separate process for each concurrent operation, but this approach incurs the cost of extra process management. T&lt;br /&gt;&lt;br /&gt;Asynchronous message passing introduces several problems. What happens if a message cannot be delivered? The sender may neve wait for delivery of the message, and thus never hear about the error. Similarly, a mechanism is needed to notify an asynchronous receiver that a message has arrived. The operation invoker could learn about completion/errors by polling, getting a software interrupt, or by waiting explicitly for completion later using a special sycnhronous wait call. An asynchronous operation needs to return a call/transaction id if the application needs to be later notified about the operation. At notification time, this id would be placed in some global location or passed as an argument to a handler or wait call.&lt;br /&gt;&lt;br /&gt;Another problem related to asynchronous message passing has to do with buffering. If messages sent asynchronously are buffered in a space managed by the OS, then a process may fill this space by flooding the system with a large number of messages.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4873923668672596462-1386653476341139972?l=openjavafaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openjavafaq.blogspot.com/feeds/1386653476341139972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4873923668672596462&amp;postID=1386653476341139972' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1386653476341139972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4873923668672596462/posts/default/1386653476341139972'/><link rel='alternate' type='text/html' href='http://openjavafaq.blogspot.com/2009/07/synchronous-vs-asynchronous.html' title='Synchronous vs Asynchronous'/><author><name>Vinayak Gupta</name><uri>http://www.blogger.com/profile/05997262601150315326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_18TrKAcuxx4/ScCRVMGuIyI/AAAAAAAAA74/-M1LWWlFTeY/S220/Binu.jpg'/></author><thr:total>0</thr:total></entry></feed>
