<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" gd:etag="W/&quot;Ak8GQX86eip7ImA9WhVTEEo.&quot;"><id>tag:blogger.com,1999:blog-8712770457197348465</id><updated>2012-02-24T02:20:20.112-08:00</updated><category term="FIX protocol" /><category term="linux" /><category term="xml" /><category term="mysql" /><category term="FIX protocol tutorial" /><category term="unix" /><category term="jsp-servlet" /><category term="programming" /><category term="interview questions" /><category term="Eclipse" /><category term="ant tutorials" /><category term="FIX Protocol interview questions" /><category term="core java interview question" /><category term="core java" /><category term="tibco" /><category term="general" /><category term="database" /><title>TIBCO RV  FIX  PROTOCOL  JAVA TUTORIAL</title><subtitle type="html">Java Tutorial tips, Unix, Linux, FIX Protocol, Tibco RV Interview Questions, Code Example in equities and high frequency electronic trading systems.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://javarevisited.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://javarevisited.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default?start-index=12&amp;max-results=11&amp;redirect=false&amp;v=2" /><author><name>Javin Paul</name><uri>https://profiles.google.com/114528699166048052030</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pap6ITQx9hQ/AAAAAAAAAAI/AAAAAAAAAJs/HjCkd0RtNhA/s512-c/photo.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>237</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>11</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/Javarevisited" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="javarevisited" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">Javarevisited</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><entry gd:etag="W/&quot;Ak8MQ3gzfSp7ImA9WhRaGEU.&quot;"><id>tag:blogger.com,1999:blog-8712770457197348465.post-1779319611138496033</id><published>2012-02-21T21:34:00.000-08:00</published><updated>2012-02-21T21:34:42.685-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-21T21:34:42.685-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="core java" /><title>How to set JAVA_HOME environment in Linux, Unix and Windows</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;span class="MsoHyperlink"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;JAVA_HOME&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt; is a system environment variable which represent JDK installation directory. When you install JDK in your machine (windows, Linux or unix) it creates a home directory and puts all its binary (bin), library(lib) and other&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;div class="MsoNormal"&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;tools. In order to compile java program &amp;quot;javac&amp;quot; tool should be in your &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;&lt;a href="http://javarevisited.blogspot.com/2011/10/how-to-set-path-for-java-unix-linux-and.html"&gt;&lt;span style="font-family: Arial;"&gt;PATH&lt;/span&gt;&lt;/a&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;and in order to get that in PATH&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;we use JAVA_HOME environment variable. Many tools like ANT and web servers like tomcat use JAVA_HOME to find java binaries. In this article we will see how to &lt;b style="mso-bidi-font-weight: normal;"&gt;set JAVA_HOME environment variable&lt;/b&gt; in different operating system including Windows (windows 7, vista, xp) and Linux (Unix).&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href="http://javarevisited.blogspot.com/2012/02/how-to-set-javahome-environment-in.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;hr/&gt;
&lt;a href="http://javarevisited.blogspot.com/"&gt;Java, Unix, Tibco RV and FIX Protocol Tutorial&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8712770457197348465-1779319611138496033?l=javarevisited.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/SgCQJMmVwLokJWKpZAV9Ea3KToU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SgCQJMmVwLokJWKpZAV9Ea3KToU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/SgCQJMmVwLokJWKpZAV9Ea3KToU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SgCQJMmVwLokJWKpZAV9Ea3KToU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=FaQRadoHC30:WH194DmdcjI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=FaQRadoHC30:WH194DmdcjI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=FaQRadoHC30:WH194DmdcjI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=FaQRadoHC30:WH194DmdcjI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=FaQRadoHC30:WH194DmdcjI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=FaQRadoHC30:WH194DmdcjI:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=FaQRadoHC30:WH194DmdcjI:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=FaQRadoHC30:WH194DmdcjI:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=FaQRadoHC30:WH194DmdcjI:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=FaQRadoHC30:WH194DmdcjI:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Javarevisited/~4/FaQRadoHC30" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://javarevisited.blogspot.com/feeds/1779319611138496033/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://javarevisited.blogspot.com/2012/02/how-to-set-javahome-environment-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default/1779319611138496033?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default/1779319611138496033?v=2" /><link rel="alternate" type="text/html" href="http://javarevisited.blogspot.com/2012/02/how-to-set-javahome-environment-in.html" title="How to set JAVA_HOME environment in Linux, Unix and Windows" /><author><name>Javin Paul</name><uri>https://profiles.google.com/114528699166048052030</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pap6ITQx9hQ/AAAAAAAAAAI/AAAAAAAAAJs/HjCkd0RtNhA/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-K6q0DQ1v-tw/TWu8owBtc2I/AAAAAAAAADA/oBoHDBiJ8ag/s72-c/17.jpg" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;DUQFQHo4eSp7ImA9WhRaGEU.&quot;"><id>tag:blogger.com,1999:blog-8712770457197348465.post-8888716474695651153</id><published>2012-02-21T21:08:00.000-08:00</published><updated>2012-02-21T21:08:31.431-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-21T21:08:31.431-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="core java interview question" /><category scheme="http://www.blogger.com/atom/ns#" term="core java" /><title>What is Race Condition in multithreading – 2 Examples in Java</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div class="MsoNormal"&gt;&lt;span class="MsoHyperlink"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;Race condition in Java&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt; is a type of concurrency bug or issue which is introduced in your program because  parallel execution of your program by multiple threads&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; at same time, Since Java is a multi-threaded programming language hence risk of Race condition is higher in Java which demands clear understanding of what causes a race condition and how to avoid that&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;. &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;Anyway &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;Race conditions are just on&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;e&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt; of hazards or risk&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;presented by  use of multi-threading in Java just like &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;&lt;a href="http://javarevisited.blogspot.com/2010/10/what-is-deadlock-in-java-how-to-fix-it.html"&gt;&lt;span style="font-family: Arial;"&gt;deadlock in Java&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;. &lt;b style="mso-bidi-font-weight: normal;"&gt;Race conditions&lt;/b&gt; occurs when two thread&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;operate on same object without proper synchronization and there operation interleaves on each other. &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;C&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;lassical&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;example&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; of Race condition&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;is incrementing a counter since increment is not an atomic operation and can be further divided into&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;three steps like read, update and write. if two &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;&lt;a href="http://javarevisited.blogspot.com/2011/02/how-to-implement-thread-in-java.html"&gt;&lt;span style="font-family: Arial;"&gt;threads&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt; tries to increment count at same time and if they&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;read same value because of interleaving of read operation of one thread to update operation of another thread,&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;one count will be lost when one thread overwrite increment done by other thread. atomic operations are not&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;subject to race conditions because those operation cannot be interleaved.&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; This is also &lt;a href="http://javarevisited.blogspot.com/2011/07/java-multi-threading-interview.html"&gt;&lt;span style="font-family: Arial;"&gt;a popular multi-threading interview questions&lt;/span&gt;&lt;/a&gt; during core java interviews. &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;In this article we will see &lt;b style="mso-bidi-font-weight: normal;"&gt;how to find race condition in Java&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; and  two&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt; sample code patterns which &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;often &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;causes race&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;conditions in Java&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href="http://javarevisited.blogspot.com/2012/02/what-is-race-condition-in.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;hr/&gt;
&lt;a href="http://javarevisited.blogspot.com/"&gt;Java, Unix, Tibco RV and FIX Protocol Tutorial&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8712770457197348465-8888716474695651153?l=javarevisited.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/L3FlMyeQtS0movghWI4zqa6Wc0o/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/L3FlMyeQtS0movghWI4zqa6Wc0o/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/L3FlMyeQtS0movghWI4zqa6Wc0o/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/L3FlMyeQtS0movghWI4zqa6Wc0o/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=-ZO6-D57jiY:S7ZiKmeJT8c:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=-ZO6-D57jiY:S7ZiKmeJT8c:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=-ZO6-D57jiY:S7ZiKmeJT8c:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=-ZO6-D57jiY:S7ZiKmeJT8c:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=-ZO6-D57jiY:S7ZiKmeJT8c:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=-ZO6-D57jiY:S7ZiKmeJT8c:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=-ZO6-D57jiY:S7ZiKmeJT8c:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=-ZO6-D57jiY:S7ZiKmeJT8c:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=-ZO6-D57jiY:S7ZiKmeJT8c:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=-ZO6-D57jiY:S7ZiKmeJT8c:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Javarevisited/~4/-ZO6-D57jiY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://javarevisited.blogspot.com/feeds/8888716474695651153/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://javarevisited.blogspot.com/2012/02/what-is-race-condition-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default/8888716474695651153?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default/8888716474695651153?v=2" /><link rel="alternate" type="text/html" href="http://javarevisited.blogspot.com/2012/02/what-is-race-condition-in.html" title="What is Race Condition in multithreading – 2 Examples in Java" /><author><name>Javin Paul</name><uri>https://profiles.google.com/114528699166048052030</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pap6ITQx9hQ/AAAAAAAAAAI/AAAAAAAAAJs/HjCkd0RtNhA/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-K6q0DQ1v-tw/TWu8owBtc2I/AAAAAAAAADA/oBoHDBiJ8ag/s72-c/17.jpg" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;DkQNR3s-fyp7ImA9WhRaGEo.&quot;"><id>tag:blogger.com,1999:blog-8712770457197348465.post-174862302120580217</id><published>2012-02-21T17:30:00.001-08:00</published><updated>2012-02-21T17:33:16.557-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-21T17:33:16.557-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jsp-servlet" /><title>JSTL set tag or &lt;c:set&gt; examples in JSP – Java J2EE Tutorial</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;span class="MsoHyperlink"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;JSTL set tag&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;or &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;"&gt;&amp;lt;c:set&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; also called as JSTL Core tag library &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;is a good replacement of &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt; text-decoration: none;"&gt;jsp:setProperty&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt; text-decoration: none;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;jsp action which lacks lot of functionality and only allow you to set bean property. you can not&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;set &lt;a href="http://javarevisited.blogspot.com/2011/12/how-to-traverse-or-loop-hashmap-in-java.html"&gt;Map&lt;/a&gt;&amp;#39;s key value or create a scoped variable by using &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;jsp:setProperty&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;. jstl &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;set&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt; tag allows you to do all the stuff related to setting or &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;creating &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;variables or attributes. by using JSTL &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;c:set&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt; tag you can :&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;/div&gt;&lt;a href="http://javarevisited.blogspot.com/2012/02/jstl-tag-examples-in-jsp-java-j2ee.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;hr/&gt;
&lt;a href="http://javarevisited.blogspot.com/"&gt;Java, Unix, Tibco RV and FIX Protocol Tutorial&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8712770457197348465-174862302120580217?l=javarevisited.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/dO5iNqKP5Dtsf-BJduzK0mo4HiM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dO5iNqKP5Dtsf-BJduzK0mo4HiM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/dO5iNqKP5Dtsf-BJduzK0mo4HiM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dO5iNqKP5Dtsf-BJduzK0mo4HiM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=3MqeP4iARU4:WYxz-2JO9Vg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=3MqeP4iARU4:WYxz-2JO9Vg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=3MqeP4iARU4:WYxz-2JO9Vg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=3MqeP4iARU4:WYxz-2JO9Vg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=3MqeP4iARU4:WYxz-2JO9Vg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=3MqeP4iARU4:WYxz-2JO9Vg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=3MqeP4iARU4:WYxz-2JO9Vg:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=3MqeP4iARU4:WYxz-2JO9Vg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=3MqeP4iARU4:WYxz-2JO9Vg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=3MqeP4iARU4:WYxz-2JO9Vg:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Javarevisited/~4/3MqeP4iARU4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://javarevisited.blogspot.com/feeds/174862302120580217/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://javarevisited.blogspot.com/2012/02/jstl-tag-examples-in-jsp-java-j2ee.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default/174862302120580217?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default/174862302120580217?v=2" /><link rel="alternate" type="text/html" href="http://javarevisited.blogspot.com/2012/02/jstl-tag-examples-in-jsp-java-j2ee.html" title="JSTL set tag or &amp;lt;c:set&amp;gt; examples in JSP – Java J2EE Tutorial" /><author><name>Javin Paul</name><uri>https://profiles.google.com/114528699166048052030</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pap6ITQx9hQ/AAAAAAAAAAI/AAAAAAAAAJs/HjCkd0RtNhA/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-K6q0DQ1v-tw/TWu8owBtc2I/AAAAAAAAADA/oBoHDBiJ8ag/s72-c/17.jpg" height="72" width="72" /><thr:total>1</thr:total></entry><entry gd:etag="W/&quot;CUQFQXk_fip7ImA9WhRaGE4.&quot;"><id>tag:blogger.com,1999:blog-8712770457197348465.post-7176920819982777948</id><published>2012-02-21T06:08:00.000-08:00</published><updated>2012-02-21T06:08:30.746-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-21T06:08:30.746-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="core java interview question" /><category scheme="http://www.blogger.com/atom/ns#" term="core java" /><title>Difference between throw and throws in Exception handling - Java Example</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;span class="MsoHyperlink"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;D&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;ifference between throw and throws&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt; keyword on Exception handling in Java is a &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;&lt;a href="http://javarevisited.blogspot.com/2011/04/top-20-core-java-interview-questions.html"&gt;&lt;span style="font-family: Arial;"&gt;popular core java interview question&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;. Exception handling being an important part of Java programming language, complete knowledge of all keywords related to exception handling e.g. &lt;b style="mso-bidi-font-weight: normal;"&gt;try&lt;/b&gt;, &lt;b style="mso-bidi-font-weight: normal;"&gt;catch&lt;/b&gt;, &lt;b style="mso-bidi-font-weight: normal;"&gt;finally&lt;/b&gt;, &lt;b style="mso-bidi-font-weight: normal;"&gt;throw&lt;/b&gt; and &lt;b style="mso-bidi-font-weight: normal;"&gt;throws&lt;/b&gt; is important&lt;i style="mso-bidi-font-style: normal;"&gt;. Main difference between throw and throws&lt;/i&gt; is in there usage and functionality. where throws is used in method signature to declare Exception possibly thrown by any method, throw is actually used to throw Exception in Java code, here is an example of both throw and throws keyword which makes it&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;easy to understand difference between them.&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;/div&gt;&lt;a href="http://javarevisited.blogspot.com/2012/02/difference-between-throw-and-throws-in.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;hr/&gt;
&lt;a href="http://javarevisited.blogspot.com/"&gt;Java, Unix, Tibco RV and FIX Protocol Tutorial&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8712770457197348465-7176920819982777948?l=javarevisited.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nRyI7lZHkYHzzDXcH2ruElPG9aM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nRyI7lZHkYHzzDXcH2ruElPG9aM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nRyI7lZHkYHzzDXcH2ruElPG9aM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nRyI7lZHkYHzzDXcH2ruElPG9aM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=UbgPRH1r-C8:xUfNXRZKZzo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=UbgPRH1r-C8:xUfNXRZKZzo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=UbgPRH1r-C8:xUfNXRZKZzo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=UbgPRH1r-C8:xUfNXRZKZzo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=UbgPRH1r-C8:xUfNXRZKZzo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=UbgPRH1r-C8:xUfNXRZKZzo:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=UbgPRH1r-C8:xUfNXRZKZzo:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=UbgPRH1r-C8:xUfNXRZKZzo:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=UbgPRH1r-C8:xUfNXRZKZzo:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=UbgPRH1r-C8:xUfNXRZKZzo:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Javarevisited/~4/UbgPRH1r-C8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://javarevisited.blogspot.com/feeds/7176920819982777948/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://javarevisited.blogspot.com/2012/02/difference-between-throw-and-throws-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default/7176920819982777948?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default/7176920819982777948?v=2" /><link rel="alternate" type="text/html" href="http://javarevisited.blogspot.com/2012/02/difference-between-throw-and-throws-in.html" title="Difference between throw and throws in Exception handling - Java Example" /><author><name>Javin Paul</name><uri>https://profiles.google.com/114528699166048052030</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pap6ITQx9hQ/AAAAAAAAAAI/AAAAAAAAAJs/HjCkd0RtNhA/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-6m5tjA8vr6A/TWhy-A_U3TI/AAAAAAAAACI/Mh2cRrSXRKA/s72-c/scratch_001.gif" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;A0MMRXk8eCp7ImA9WhRaFkw.&quot;"><id>tag:blogger.com,1999:blog-8712770457197348465.post-936584202825509322</id><published>2012-02-18T18:44:00.000-08:00</published><updated>2012-02-18T18:44:44.770-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-18T18:44:44.770-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="core java interview question" /><category scheme="http://www.blogger.com/atom/ns#" term="core java" /><title>Difference between LinkedList vs ArrayList in Java</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;LinkedList and &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;&lt;a href="http://javarevisited.blogspot.com/2011/05/example-of-arraylist-in-java-tutorial.html"&gt;&lt;span style="font-family: Arial;"&gt;ArrayList&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt; both implement List Interface but how they work internally is where the differences lies. Main &lt;b style="mso-bidi-font-weight: normal;"&gt;difference&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;between ArrayList and LinkedLis&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;t is that ArrayList is implemented using re sizable array while LinkedList is implemented using&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;doubly LinkedList. ArrayList is more popular among Java programmer than LinkedList as there are few scenarios on which LinkedList&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;is a suitable collection than ArrayList. In this article we will see some &lt;i style="mso-bidi-font-style: normal;"&gt;differences between LinkedList and ArrayList &lt;/i&gt;and try&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;to find out &lt;b style="mso-bidi-font-weight: normal;"&gt;when and where to use LinkedList over ArrayList&lt;/b&gt;.&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;/div&gt;&lt;a href="http://javarevisited.blogspot.com/2012/02/difference-between-linkedlist-vs.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;hr/&gt;
&lt;a href="http://javarevisited.blogspot.com/"&gt;Java, Unix, Tibco RV and FIX Protocol Tutorial&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8712770457197348465-936584202825509322?l=javarevisited.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1DSr5jCq5-DHM94drTDtJFIojCc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1DSr5jCq5-DHM94drTDtJFIojCc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1DSr5jCq5-DHM94drTDtJFIojCc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1DSr5jCq5-DHM94drTDtJFIojCc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=dNnVDNHg4Mw:S3ZeaJ74GmQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=dNnVDNHg4Mw:S3ZeaJ74GmQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=dNnVDNHg4Mw:S3ZeaJ74GmQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=dNnVDNHg4Mw:S3ZeaJ74GmQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=dNnVDNHg4Mw:S3ZeaJ74GmQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=dNnVDNHg4Mw:S3ZeaJ74GmQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=dNnVDNHg4Mw:S3ZeaJ74GmQ:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=dNnVDNHg4Mw:S3ZeaJ74GmQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=dNnVDNHg4Mw:S3ZeaJ74GmQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=dNnVDNHg4Mw:S3ZeaJ74GmQ:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Javarevisited/~4/dNnVDNHg4Mw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://javarevisited.blogspot.com/feeds/936584202825509322/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://javarevisited.blogspot.com/2012/02/difference-between-linkedlist-vs.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default/936584202825509322?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default/936584202825509322?v=2" /><link rel="alternate" type="text/html" href="http://javarevisited.blogspot.com/2012/02/difference-between-linkedlist-vs.html" title="Difference between LinkedList vs ArrayList in Java" /><author><name>Javin Paul</name><uri>https://profiles.google.com/114528699166048052030</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pap6ITQx9hQ/AAAAAAAAAAI/AAAAAAAAAJs/HjCkd0RtNhA/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-K6q0DQ1v-tw/TWu8owBtc2I/AAAAAAAAADA/oBoHDBiJ8ag/s72-c/17.jpg" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;A0QESXw-cSp7ImA9WhRaFU4.&quot;"><id>tag:blogger.com,1999:blog-8712770457197348465.post-5069503034064958264</id><published>2012-02-17T06:38:00.000-08:00</published><updated>2012-02-17T20:28:28.259-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-17T20:28:28.259-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="core java" /><title>How to encode decode String in Java base64 Encoding</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div class="MsoNormal"&gt;&lt;span class="MsoHyperlink"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;Encoding and Decoding of String in Java&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt; using b&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;a&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;se64 is extremely easy if you are using &lt;b style="mso-bidi-font-weight: normal;"&gt;apache commons code&lt;/b&gt; open&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;source library. it provides convenient &lt;a href="http://javarevisited.blogspot.com/2011/11/static-keyword-method-variable-java.html"&gt;static &lt;/a&gt;utility method &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt; text-decoration: none;"&gt;Base64.encodeBase64(byte[])&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt; and &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt; text-decoration: none;"&gt;Base64.decodeBase64(byte [])&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;for &lt;b style="mso-bidi-font-weight: normal;"&gt;converting binary data into base64 encoded&lt;/b&gt; binary Stream and than decoding back from encoded data in base64&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;span style="font-family: Arial;"&gt;encoding &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;mechanism. Many times we need to encode sensitive data be it binary String  format transferring over socket or transferring&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;or storing data in xml files. Though there are other open source library available which provides support to&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;encode any String into base64 e.g. &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt; text-decoration: none;"&gt;MimeUtil&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt; from &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;javax.mail &lt;/span&gt;package but Apache commons codec package is really&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;handy and doesn&amp;#39;t add lot of extra stuff. its API is also very neat and clean. In this article we will see &lt;b&gt;how to encode and decode String into base64 encoding&lt;/b&gt;.&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;a href="http://javarevisited.blogspot.com/2012/02/how-to-encode-decode-string-in-java.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;hr/&gt;
&lt;a href="http://javarevisited.blogspot.com/"&gt;Java, Unix, Tibco RV and FIX Protocol Tutorial&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8712770457197348465-5069503034064958264?l=javarevisited.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/NyybxvQrY1Mut8OTkmTdAq4vJWM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NyybxvQrY1Mut8OTkmTdAq4vJWM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/NyybxvQrY1Mut8OTkmTdAq4vJWM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NyybxvQrY1Mut8OTkmTdAq4vJWM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=lTYOD5EPcj8:SGDp4OdkMIE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=lTYOD5EPcj8:SGDp4OdkMIE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=lTYOD5EPcj8:SGDp4OdkMIE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=lTYOD5EPcj8:SGDp4OdkMIE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=lTYOD5EPcj8:SGDp4OdkMIE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=lTYOD5EPcj8:SGDp4OdkMIE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=lTYOD5EPcj8:SGDp4OdkMIE:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=lTYOD5EPcj8:SGDp4OdkMIE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=lTYOD5EPcj8:SGDp4OdkMIE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=lTYOD5EPcj8:SGDp4OdkMIE:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Javarevisited/~4/lTYOD5EPcj8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://javarevisited.blogspot.com/feeds/5069503034064958264/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://javarevisited.blogspot.com/2012/02/how-to-encode-decode-string-in-java.html#comment-form" title="9 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default/5069503034064958264?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default/5069503034064958264?v=2" /><link rel="alternate" type="text/html" href="http://javarevisited.blogspot.com/2012/02/how-to-encode-decode-string-in-java.html" title="How to encode decode String in Java base64 Encoding" /><author><name>Javin Paul</name><uri>https://profiles.google.com/114528699166048052030</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pap6ITQx9hQ/AAAAAAAAAAI/AAAAAAAAAJs/HjCkd0RtNhA/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-wrzDeQGAe1I/TWu8pLuLr4I/AAAAAAAAADE/V017G-6Q61w/s72-c/java_logo_50_50.jpg" height="72" width="72" /><thr:total>9</thr:total></entry><entry gd:etag="W/&quot;A08ASXY5cSp7ImA9WhRaE0Q.&quot;"><id>tag:blogger.com,1999:blog-8712770457197348465.post-8379818278416374862</id><published>2012-02-16T05:44:00.000-08:00</published><updated>2012-02-16T05:44:08.829-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-16T05:44:08.829-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="core java interview question" /><category scheme="http://www.blogger.com/atom/ns#" term="core java" /><title>Producer Consumer Design Pattern with Blocking Queue Example in Java</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div class="MsoNormal"&gt;&lt;span class="MsoHyperlink"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;Producer Consumer Design pattern&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt; is a classic concurrency or threading pattern which reduces coupling between&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;Producer and Consumer by separating Identification of work with Execution of Work. In producer consumer design pattern a shared queue is used to control the flow and this separation allows you to code producer and consumer separately. It also addresses the issue of different timing require to produce item or consuming item. by using &lt;b style="mso-bidi-font-weight: normal;"&gt;producer consumer pattern&lt;/b&gt; both Producer and Consumer Thread can work with different speed. In this article we will see &lt;i style="mso-bidi-font-style: normal;"&gt;What is producer consumer problem&lt;/i&gt; which is very &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;&lt;a href="http://javarevisited.blogspot.com/2011/07/java-multi-threading-interview.html"&gt;&lt;span style="font-family: Arial;"&gt;popular multi-threading interview question&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;, How to solve producer consumer problem using Blocking Queue and Benefits of using Producer Consumer design pattern.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href="http://javarevisited.blogspot.com/2012/02/producer-consumer-design-pattern-with.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;hr/&gt;
&lt;a href="http://javarevisited.blogspot.com/"&gt;Java, Unix, Tibco RV and FIX Protocol Tutorial&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8712770457197348465-8379818278416374862?l=javarevisited.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/K60OI0niZPFvtbGGEM4dEL2juFw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/K60OI0niZPFvtbGGEM4dEL2juFw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/K60OI0niZPFvtbGGEM4dEL2juFw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/K60OI0niZPFvtbGGEM4dEL2juFw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=_OH7y4x-dvQ:AADhDrkOmxA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=_OH7y4x-dvQ:AADhDrkOmxA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=_OH7y4x-dvQ:AADhDrkOmxA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=_OH7y4x-dvQ:AADhDrkOmxA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=_OH7y4x-dvQ:AADhDrkOmxA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=_OH7y4x-dvQ:AADhDrkOmxA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=_OH7y4x-dvQ:AADhDrkOmxA:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=_OH7y4x-dvQ:AADhDrkOmxA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=_OH7y4x-dvQ:AADhDrkOmxA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=_OH7y4x-dvQ:AADhDrkOmxA:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Javarevisited/~4/_OH7y4x-dvQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://javarevisited.blogspot.com/feeds/8379818278416374862/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://javarevisited.blogspot.com/2012/02/producer-consumer-design-pattern-with.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default/8379818278416374862?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default/8379818278416374862?v=2" /><link rel="alternate" type="text/html" href="http://javarevisited.blogspot.com/2012/02/producer-consumer-design-pattern-with.html" title="Producer Consumer Design Pattern with Blocking Queue Example in Java" /><author><name>Javin Paul</name><uri>https://profiles.google.com/114528699166048052030</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pap6ITQx9hQ/AAAAAAAAAAI/AAAAAAAAAJs/HjCkd0RtNhA/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-wrzDeQGAe1I/TWu8pLuLr4I/AAAAAAAAADE/V017G-6Q61w/s72-c/java_logo_50_50.jpg" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CkINQ306cSp7ImA9WhRaE0w.&quot;"><id>tag:blogger.com,1999:blog-8712770457197348465.post-5058694593135922951</id><published>2012-02-15T04:56:00.000-08:00</published><updated>2012-02-15T04:56:32.319-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-15T04:56:32.319-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="core java" /><title>Why non-static variable cannot be referenced from a static context?</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;&amp;quot;&lt;b style="mso-bidi-font-weight: normal;"&gt;non-static variable cannot be referenced from a static context&lt;/b&gt;&amp;quot; is biggest nemesis of some one who has just&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;div class="MsoNormal"&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;started pro&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;gramming and that too in Java. S&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;ince &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;&lt;a href="http://javarevisited.blogspot.com/2011/12/main-public-static-java-void-method-why.html"&gt;&lt;span style="font-family: Arial;"&gt;main method in java&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt; is most popular method among all beginners and&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;they try to put program code there they face &amp;quot;&lt;i style="mso-bidi-font-style: normal;"&gt;non-static variable cannot be referenced from a static context&lt;/i&gt;&amp;quot; &lt;b style="mso-bidi-font-weight: normal;"&gt;compiler error&lt;/b&gt;&lt;b&gt; &lt;/b&gt;when they  try to access a non static member variable inside main in Java which is static. if you want to know&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;why main is declared static in Java see the link.&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;a href="http://javarevisited.blogspot.com/2012/02/why-non-static-variable-cannot-be.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;hr/&gt;
&lt;a href="http://javarevisited.blogspot.com/"&gt;Java, Unix, Tibco RV and FIX Protocol Tutorial&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8712770457197348465-5058694593135922951?l=javarevisited.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Ds9x9ErBV5UVRYkOQcbD7_10QiY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ds9x9ErBV5UVRYkOQcbD7_10QiY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Ds9x9ErBV5UVRYkOQcbD7_10QiY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ds9x9ErBV5UVRYkOQcbD7_10QiY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=IFVY0ikudsw:XiEhGLsfbEA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=IFVY0ikudsw:XiEhGLsfbEA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=IFVY0ikudsw:XiEhGLsfbEA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=IFVY0ikudsw:XiEhGLsfbEA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=IFVY0ikudsw:XiEhGLsfbEA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=IFVY0ikudsw:XiEhGLsfbEA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=IFVY0ikudsw:XiEhGLsfbEA:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=IFVY0ikudsw:XiEhGLsfbEA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=IFVY0ikudsw:XiEhGLsfbEA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=IFVY0ikudsw:XiEhGLsfbEA:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Javarevisited/~4/IFVY0ikudsw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://javarevisited.blogspot.com/feeds/5058694593135922951/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://javarevisited.blogspot.com/2012/02/why-non-static-variable-cannot-be.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default/5058694593135922951?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default/5058694593135922951?v=2" /><link rel="alternate" type="text/html" href="http://javarevisited.blogspot.com/2012/02/why-non-static-variable-cannot-be.html" title="Why non-static variable cannot be referenced from a static context?" /><author><name>Javin Paul</name><uri>https://profiles.google.com/114528699166048052030</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pap6ITQx9hQ/AAAAAAAAAAI/AAAAAAAAAJs/HjCkd0RtNhA/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-wrzDeQGAe1I/TWu8pLuLr4I/AAAAAAAAADE/V017G-6Q61w/s72-c/java_logo_50_50.jpg" height="72" width="72" /><thr:total>1</thr:total></entry><entry gd:etag="W/&quot;CUAERns5fip7ImA9WhRbGUk.&quot;"><id>tag:blogger.com,1999:blog-8712770457197348465.post-7321451680832646845</id><published>2012-02-10T23:01:00.000-08:00</published><updated>2012-02-10T23:01:47.526-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-10T23:01:47.526-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="core java interview question" /><category scheme="http://www.blogger.com/atom/ns#" term="core java" /><title>fail-safe vs fail-fast Iterator in Java</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div class="MsoNormal"&gt;&lt;span class="MsoHyperlink"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;Difference between fail-safe and fail-fast Iterator&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt; is becoming &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;&lt;a href="http://javarevisited.blogspot.com/2011/04/top-20-core-java-interview-questions.html"&gt;&lt;span style="font-family: Arial;"&gt;favorite core java interview questions&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt; day by day, reason&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;it touches concurrency a bit and interviewee can go deep on it to ask &lt;i style="mso-bidi-font-style: normal;"&gt;how fail-safe or fail-fast behavior is implemented&lt;/i&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;In this article article we will see &lt;b style="mso-bidi-font-weight: normal;"&gt;what is fail-safe and fail fast iterators in java&lt;/b&gt; and differences between &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;fail-fast and fail-safe iterators &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; Concept of fail-safe iterator are relatively new in Java and first introduced with &lt;a href="http://javarevisited.blogspot.com/2011/04/difference-between-concurrenthashmap.html"&gt;&lt;span style="font-family: Arial;"&gt;Concurrent Collections in Java&lt;/span&gt;&lt;/a&gt; 5 like &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;"&gt;ConcurrentHashMap&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; and &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;"&gt;CopyOnWriteArrayList&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href="http://javarevisited.blogspot.com/2012/02/fail-safe-vs-fail-fast-iterator-in-java.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;hr/&gt;
&lt;a href="http://javarevisited.blogspot.com/"&gt;Java, Unix, Tibco RV and FIX Protocol Tutorial&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8712770457197348465-7321451680832646845?l=javarevisited.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5wdv3Kxk0_CmfvHo46kYSwVoxN8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5wdv3Kxk0_CmfvHo46kYSwVoxN8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5wdv3Kxk0_CmfvHo46kYSwVoxN8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5wdv3Kxk0_CmfvHo46kYSwVoxN8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=NgJmm7cEOyo:xFiwg2y1VNE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=NgJmm7cEOyo:xFiwg2y1VNE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=NgJmm7cEOyo:xFiwg2y1VNE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=NgJmm7cEOyo:xFiwg2y1VNE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=NgJmm7cEOyo:xFiwg2y1VNE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=NgJmm7cEOyo:xFiwg2y1VNE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=NgJmm7cEOyo:xFiwg2y1VNE:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=NgJmm7cEOyo:xFiwg2y1VNE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=NgJmm7cEOyo:xFiwg2y1VNE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=NgJmm7cEOyo:xFiwg2y1VNE:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Javarevisited/~4/NgJmm7cEOyo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://javarevisited.blogspot.com/feeds/7321451680832646845/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://javarevisited.blogspot.com/2012/02/fail-safe-vs-fail-fast-iterator-in-java.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default/7321451680832646845?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default/7321451680832646845?v=2" /><link rel="alternate" type="text/html" href="http://javarevisited.blogspot.com/2012/02/fail-safe-vs-fail-fast-iterator-in-java.html" title="fail-safe vs fail-fast Iterator in Java" /><author><name>Javin Paul</name><uri>https://profiles.google.com/114528699166048052030</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pap6ITQx9hQ/AAAAAAAAAAI/AAAAAAAAAJs/HjCkd0RtNhA/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-wrzDeQGAe1I/TWu8pLuLr4I/AAAAAAAAADE/V017G-6Q61w/s72-c/java_logo_50_50.jpg" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;A0MCQno-eCp7ImA9WhRbF0U.&quot;"><id>tag:blogger.com,1999:blog-8712770457197348465.post-5769446513810359501</id><published>2012-02-08T06:39:00.000-08:00</published><updated>2012-02-09T04:11:03.450-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-09T04:11:03.450-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="core java" /><title>How to fix java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory  or &amp;quot;&lt;b&gt;Exception in thread &amp;quot;main&amp;quot; java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory&lt;/b&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;exception comes when you don&amp;#39;t apache commons-logging-1.1.1.jar in your Classpath. I have faced this exception many times while using open&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;source framework like Struts, Spring and Displaytag which uses commons-logging framework for logging. commons-logging&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;is not an actual java logging framework but provides a wrapper so that you can use log4j, &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;&lt;a href="http://javarevisited.blogspot.com/2011/05/top-10-tips-on-logging-in-java.html"&gt;&lt;span style="font-family: Arial;"&gt;java logging&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt; or any&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;other Java logging framework. commons-logging is also smart enough to detect which logging framework are you using e.g&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;if you are using log4j it can detect it by looing log4j.jar in your classpath. but if you don&amp;#39;t have commons-logging.jar&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;in your classpath you may get &lt;b style="mso-bidi-font-weight: normal;"&gt;java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory&lt;/b&gt; at runtime even&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;if your application gets deployed successfully.&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;/div&gt;&lt;a href="http://javarevisited.blogspot.com/2012/02/orgapachecommonslogginglogfactory-error.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;hr/&gt;
&lt;a href="http://javarevisited.blogspot.com/"&gt;Java, Unix, Tibco RV and FIX Protocol Tutorial&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8712770457197348465-5769446513810359501?l=javarevisited.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/I4YFJyMaVQB_T9KvhgrUyauRGLs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/I4YFJyMaVQB_T9KvhgrUyauRGLs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/I4YFJyMaVQB_T9KvhgrUyauRGLs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/I4YFJyMaVQB_T9KvhgrUyauRGLs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=pfmGuNATbTQ:hajhPxsBXHk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=pfmGuNATbTQ:hajhPxsBXHk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=pfmGuNATbTQ:hajhPxsBXHk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=pfmGuNATbTQ:hajhPxsBXHk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=pfmGuNATbTQ:hajhPxsBXHk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=pfmGuNATbTQ:hajhPxsBXHk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=pfmGuNATbTQ:hajhPxsBXHk:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=pfmGuNATbTQ:hajhPxsBXHk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=pfmGuNATbTQ:hajhPxsBXHk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=pfmGuNATbTQ:hajhPxsBXHk:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Javarevisited/~4/pfmGuNATbTQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://javarevisited.blogspot.com/feeds/5769446513810359501/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://javarevisited.blogspot.com/2012/02/orgapachecommonslogginglogfactory-error.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default/5769446513810359501?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default/5769446513810359501?v=2" /><link rel="alternate" type="text/html" href="http://javarevisited.blogspot.com/2012/02/orgapachecommonslogginglogfactory-error.html" title="How to fix java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory" /><author><name>Javin Paul</name><uri>https://profiles.google.com/114528699166048052030</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pap6ITQx9hQ/AAAAAAAAAAI/AAAAAAAAAJs/HjCkd0RtNhA/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-wrzDeQGAe1I/TWu8pLuLr4I/AAAAAAAAADE/V017G-6Q61w/s72-c/java_logo_50_50.jpg" height="72" width="72" /><thr:total>1</thr:total></entry><entry gd:etag="W/&quot;DE8FRn8yfSp7ImA9WhRaFEU.&quot;"><id>tag:blogger.com,1999:blog-8712770457197348465.post-3031105769783490859</id><published>2012-02-06T06:20:00.000-08:00</published><updated>2012-02-17T05:53:37.195-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-17T05:53:37.195-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="core java" /><title>What is blocking methods in Java and how do deal with it?</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;span class="MsoHyperlink"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;Blocking methods in Java&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt; are those method which &lt;b style="mso-bidi-font-weight: normal;"&gt;block the executing thread&lt;/b&gt; until there operation finished. &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt;Famous&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;div class="MsoNormal"&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;example of blocking method is InputStream read() method which blocks until all data from InputStream has been read&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;completely. Correct understanding of blocking methods are required if you are serious towards Java programming specially&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;in early days because if not used carefully blocking method can freeze GUIs, hung your program and become non responsive&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;for longer duration of time. In this post we will see &lt;b style="mso-bidi-font-weight: normal;"&gt;What is Blocking methods in Java&lt;/b&gt;, Examples of Blocking methods and&lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-size: 9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="color: black; font-family: Arial; font-size: 9pt; text-decoration: none;"&gt;Some &lt;b style="mso-bidi-font-weight: normal;"&gt;best practices around blocking methods&lt;/b&gt; and how to use blocking methods in Java.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href="http://javarevisited.blogspot.com/2012/02/what-is-blocking-methods-in-java-and.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;hr/&gt;
&lt;a href="http://javarevisited.blogspot.com/"&gt;Java, Unix, Tibco RV and FIX Protocol Tutorial&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8712770457197348465-3031105769783490859?l=javarevisited.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ep63QI5Sr9v7wWYWO3PKMgvRHhQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ep63QI5Sr9v7wWYWO3PKMgvRHhQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ep63QI5Sr9v7wWYWO3PKMgvRHhQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ep63QI5Sr9v7wWYWO3PKMgvRHhQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=cXrVLBJvstQ:4-oVJ8nfVeU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=cXrVLBJvstQ:4-oVJ8nfVeU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=cXrVLBJvstQ:4-oVJ8nfVeU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=cXrVLBJvstQ:4-oVJ8nfVeU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=cXrVLBJvstQ:4-oVJ8nfVeU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=cXrVLBJvstQ:4-oVJ8nfVeU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=cXrVLBJvstQ:4-oVJ8nfVeU:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=cXrVLBJvstQ:4-oVJ8nfVeU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?i=cXrVLBJvstQ:4-oVJ8nfVeU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Javarevisited?a=cXrVLBJvstQ:4-oVJ8nfVeU:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Javarevisited?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Javarevisited/~4/cXrVLBJvstQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://javarevisited.blogspot.com/feeds/3031105769783490859/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://javarevisited.blogspot.com/2012/02/what-is-blocking-methods-in-java-and.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default/3031105769783490859?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8712770457197348465/posts/default/3031105769783490859?v=2" /><link rel="alternate" type="text/html" href="http://javarevisited.blogspot.com/2012/02/what-is-blocking-methods-in-java-and.html" title="What is blocking methods in Java and how do deal with it?" /><author><name>Javin Paul</name><uri>https://profiles.google.com/114528699166048052030</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pap6ITQx9hQ/AAAAAAAAAAI/AAAAAAAAAJs/HjCkd0RtNhA/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-wrzDeQGAe1I/TWu8pLuLr4I/AAAAAAAAADE/V017G-6Q61w/s72-c/java_logo_50_50.jpg" height="72" width="72" /><thr:total>0</thr:total></entry></feed>

