<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:gd="http://schemas.google.com/g/2005" xmlns:georss="http://www.georss.org/georss" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:thr="http://purl.org/syndication/thread/1.0"><id>tag:blogger.com,1999:blog-5074681044290083024</id><updated>2026-01-11T21:20:24.266+05:30</updated><category term="Core Java"/><category term="Collections"/><category term="OOPs Concepts"/><category term="java"/><category term="servlet"/><category term="HashMap"/><category term="jsp"/><category term="multithreading"/><category term="Exception Handling"/><category term="J2EE"/><category term="ConcurrentHashMap"/><category term="HashSet"/><category term="Hashtable"/><category term="Properties"/><category term="TreeSet"/><category term="volatile"/><title type="text">JAVA J2EE Interview Questions and Answers</title><subtitle type="html">You will find here collection of JAVA, J2EE interview questions and answers. This blog includes topics like Core JAVA&#13;
, Advanced JAVA, RMI, JDBC, JSP, Servlet, EJB, JMS. It has difference, comparison of java concepts. This blog will help freshers as well as experienced people to prepare for java, j2ee interview questions answers.</subtitle><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default?alt=atom&amp;redirect=false" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/" rel="alternate" type="text/html"/><link href="http://pubsubhubbub.appspot.com/" rel="hub"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default?alt=atom&amp;start-index=26&amp;max-results=25&amp;redirect=false" rel="next" type="application/atom+xml"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><generator uri="http://www.blogger.com" version="7.00">Blogger</generator><openSearch:totalResults>33</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><xhtml:meta content="noindex" name="robots" xmlns:xhtml="http://www.w3.org/1999/xhtml"/><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-7207673864308951781</id><published>2011-03-13T19:11:00.001+05:30</published><updated>2011-03-13T19:13:49.675+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Core Java"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type="text">JAVA 7 Features</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
 {font-family:"Cambria Math";
 panose-1:2 4 5 3 5 4 6 3 2 4;
 mso-font-charset:1;
 mso-generic-font-family:roman;
 mso-font-format:other;
 mso-font-pitch:variable;
 mso-font-signature:0 0 0 0 0 0;}
@font-face
 {font-family:Cambria;
 panose-1:2 4 5 3 5 4 6 3 2 4;
 mso-font-charset:0;
 mso-generic-font-family:roman;
 mso-font-pitch:variable;
 mso-font-signature:-1610611985 1073741899 0 0 159 0;}
@font-face
 {font-family:Calibri;
 panose-1:2 15 5 2 2 2 4 3 2 4;
 mso-font-charset:0;
 mso-generic-font-family:swiss;
 mso-font-pitch:variable;
 mso-font-signature:-1610611985 1073750139 0 0 159 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
 {mso-style-unhide:no;
 mso-style-qformat:yes;
 mso-style-parent:"";
 margin-top:0in;
 margin-right:0in;
 margin-bottom:10.0pt;
 margin-left:0in;
 line-height:115%;
 mso-pagination:widow-orphan;
 font-size:11.0pt;
 font-family:"Calibri","sans-serif";
 mso-ascii-font-family:Calibri;
 mso-ascii-theme-font:minor-latin;
 mso-fareast-font-family:Calibri;
 mso-fareast-theme-font:minor-latin;
 mso-hansi-font-family:Calibri;
 mso-hansi-theme-font:minor-latin;
 mso-bidi-font-family:"Times New Roman";
 mso-bidi-theme-font:minor-bidi;}
h1
 {mso-style-priority:9;
 mso-style-unhide:no;
 mso-style-qformat:yes;
 mso-style-link:"Heading 1 Char";
 mso-style-next:Normal;
 margin-top:24.0pt;
 margin-right:0in;
 margin-bottom:0in;
 margin-left:0in;
 margin-bottom:.0001pt;
 line-height:115%;
 mso-pagination:widow-orphan lines-together;
 page-break-after:avoid;
 mso-outline-level:1;
 font-size:14.0pt;
 font-family:"Cambria","serif";
 mso-ascii-font-family:Cambria;
 mso-ascii-theme-font:major-latin;
 mso-fareast-font-family:"Times New Roman";
 mso-fareast-theme-font:major-fareast;
 mso-hansi-font-family:Cambria;
 mso-hansi-theme-font:major-latin;
 mso-bidi-font-family:"Times New Roman";
 mso-bidi-theme-font:major-bidi;
 color:#365F91;
 mso-themecolor:accent1;
 mso-themeshade:191;
 mso-font-kerning:0pt;}
h2
 {mso-style-priority:9;
 mso-style-qformat:yes;
 mso-style-link:"Heading 2 Char";
 mso-style-next:Normal;
 margin-top:10.0pt;
 margin-right:0in;
 margin-bottom:0in;
 margin-left:0in;
 margin-bottom:.0001pt;
 line-height:115%;
 mso-pagination:widow-orphan lines-together;
 page-break-after:avoid;
 mso-outline-level:2;
 font-size:13.0pt;
 font-family:"Cambria","serif";
 mso-ascii-font-family:Cambria;
 mso-ascii-theme-font:major-latin;
 mso-fareast-font-family:"Times New Roman";
 mso-fareast-theme-font:major-fareast;
 mso-hansi-font-family:Cambria;
 mso-hansi-theme-font:major-latin;
 mso-bidi-font-family:"Times New Roman";
 mso-bidi-theme-font:major-bidi;
 color:#4F81BD;
 mso-themecolor:accent1;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
 {mso-style-priority:34;
 mso-style-unhide:no;
 mso-style-qformat:yes;
 margin-top:0in;
 margin-right:0in;
 margin-bottom:10.0pt;
 margin-left:.5in;
 mso-add-space:auto;
 line-height:115%;
 mso-pagination:widow-orphan;
 font-size:11.0pt;
 font-family:"Calibri","sans-serif";
 mso-ascii-font-family:Calibri;
 mso-ascii-theme-font:minor-latin;
 mso-fareast-font-family:Calibri;
 mso-fareast-theme-font:minor-latin;
 mso-hansi-font-family:Calibri;
 mso-hansi-theme-font:minor-latin;
 mso-bidi-font-family:"Times New Roman";
 mso-bidi-theme-font:minor-bidi;}
p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst
 {mso-style-priority:34;
 mso-style-unhide:no;
 mso-style-qformat:yes;
 mso-style-type:export-only;
 margin-top:0in;
 margin-right:0in;
 margin-bottom:0in;
 margin-left:.5in;
 margin-bottom:.0001pt;
 mso-add-space:auto;
 line-height:115%;
 mso-pagination:widow-orphan;
 font-size:11.0pt;
 font-family:"Calibri","sans-serif";
 mso-ascii-font-family:Calibri;
 mso-ascii-theme-font:minor-latin;
 mso-fareast-font-family:Calibri;
 mso-fareast-theme-font:minor-latin;
 mso-hansi-font-family:Calibri;
 mso-hansi-theme-font:minor-latin;
 mso-bidi-font-family:"Times New Roman";
 mso-bidi-theme-font:minor-bidi;}
p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle
 {mso-style-priority:34;
 mso-style-unhide:no;
 mso-style-qformat:yes;
 mso-style-type:export-only;
 margin-top:0in;
 margin-right:0in;
 margin-bottom:0in;
 margin-left:.5in;
 margin-bottom:.0001pt;
 mso-add-space:auto;
 line-height:115%;
 mso-pagination:widow-orphan;
 font-size:11.0pt;
 font-family:"Calibri","sans-serif";
 mso-ascii-font-family:Calibri;
 mso-ascii-theme-font:minor-latin;
 mso-fareast-font-family:Calibri;
 mso-fareast-theme-font:minor-latin;
 mso-hansi-font-family:Calibri;
 mso-hansi-theme-font:minor-latin;
 mso-bidi-font-family:"Times New Roman";
 mso-bidi-theme-font:minor-bidi;}
p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast
 {mso-style-priority:34;
 mso-style-unhide:no;
 mso-style-qformat:yes;
 mso-style-type:export-only;
 margin-top:0in;
 margin-right:0in;
 margin-bottom:10.0pt;
 margin-left:.5in;
 mso-add-space:auto;
 line-height:115%;
 mso-pagination:widow-orphan;
 font-size:11.0pt;
 font-family:"Calibri","sans-serif";
 mso-ascii-font-family:Calibri;
 mso-ascii-theme-font:minor-latin;
 mso-fareast-font-family:Calibri;
 mso-fareast-theme-font:minor-latin;
 mso-hansi-font-family:Calibri;
 mso-hansi-theme-font:minor-latin;
 mso-bidi-font-family:"Times New Roman";
 mso-bidi-theme-font:minor-bidi;}
span.Heading1Char
 {mso-style-name:"Heading 1 Char";
 mso-style-priority:9;
 mso-style-unhide:no;
 mso-style-locked:yes;
 mso-style-link:"Heading 1";
 mso-ansi-font-size:14.0pt;
 mso-bidi-font-size:14.0pt;
 font-family:"Cambria","serif";
 mso-ascii-font-family:Cambria;
 mso-ascii-theme-font:major-latin;
 mso-fareast-font-family:"Times New Roman";
 mso-fareast-theme-font:major-fareast;
 mso-hansi-font-family:Cambria;
 mso-hansi-theme-font:major-latin;
 mso-bidi-font-family:"Times New Roman";
 mso-bidi-theme-font:major-bidi;
 color:#365F91;
 mso-themecolor:accent1;
 mso-themeshade:191;
 font-weight:bold;}
span.Heading2Char
 {mso-style-name:"Heading 2 Char";
 mso-style-priority:9;
 mso-style-unhide:no;
 mso-style-locked:yes;
 mso-style-link:"Heading 2";
 mso-ansi-font-size:13.0pt;
 mso-bidi-font-size:13.0pt;
 font-family:"Cambria","serif";
 mso-ascii-font-family:Cambria;
 mso-ascii-theme-font:major-latin;
 mso-fareast-font-family:"Times New Roman";
 mso-fareast-theme-font:major-fareast;
 mso-hansi-font-family:Cambria;
 mso-hansi-theme-font:major-latin;
 mso-bidi-font-family:"Times New Roman";
 mso-bidi-theme-font:major-bidi;
 color:#4F81BD;
 mso-themecolor:accent1;
 font-weight:bold;}
.MsoChpDefault
 {mso-style-type:export-only;
 mso-default-props:yes;
 mso-ascii-font-family:Calibri;
 mso-ascii-theme-font:minor-latin;
 mso-fareast-font-family:Calibri;
 mso-fareast-theme-font:minor-latin;
 mso-hansi-font-family:Calibri;
 mso-hansi-theme-font:minor-latin;
 mso-bidi-font-family:"Times New Roman";
 mso-bidi-theme-font:minor-bidi;}
.MsoPapDefault
 {mso-style-type:export-only;
 margin-bottom:10.0pt;
 line-height:115%;}
@page WordSection1
 {size:8.5in 11.0in;
 margin:1.0in 1.0in 1.0in 1.0in;
 mso-header-margin:.5in;
 mso-footer-margin:.5in;
 mso-paper-source:0;}
div.WordSection1
 {page:WordSection1;}
 /* List Definitions */
 @list l0
 {mso-list-id:407771730;
 mso-list-type:hybrid;
 mso-list-template-ids:-830042492 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
 {mso-level-tab-stop:none;
 mso-level-number-position:left;
 text-indent:-.25in;}
ol
 {margin-bottom:0in;}
ul
 {margin-bottom:0in;}
--&gt;
&lt;/style&gt;  &lt;br /&gt;
&lt;h1&gt;Virtul Machine&lt;o:p&gt;&lt;/o:p&gt;&lt;/h1&gt;&lt;h2&gt;JSR 292: Support for dynamically-typed languages (InvokeDynamic)&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;VM and language extensions to support the implementation of dynamically-typed languages at performance levels near to that of the Java language itself&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;b&gt;&lt;span style="color: #4f81bd; font-family: &amp;quot;Cambria&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 13pt;"&gt;Strict class-file checking [NEW]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Per the Java SE 6 specification, class files of version 51 (SE 7) or later must be verified with the typechecking verifier introduced by JSR 202 in Java SE 6; the VM must not fail over to the old inferencing verifier&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h1&gt;Language&lt;o:p&gt;&lt;/o:p&gt;&lt;/h1&gt;&lt;h2&gt;JSR 334: Small language enhancements (Project Coin)&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;A set of small language changes intended to simplify common, day-to-day programming tasks: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoListParagraphCxSpFirst" style="line-height: normal; margin-bottom: 0.0001pt; text-indent: -0.25in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;1.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Strings in switch statements&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoListParagraphCxSpMiddle" style="line-height: normal; margin-bottom: 0.0001pt; text-indent: -0.25in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;2.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Automatic resource management&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoListParagraphCxSpMiddle" style="line-height: normal; margin-bottom: 0.0001pt; text-indent: -0.25in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;3.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Improved type inference for generic instance creation ("diamond")&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoListParagraphCxSpMiddle" style="line-height: normal; margin-bottom: 0.0001pt; text-indent: -0.25in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;4.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Simplified varargs method invocation,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoListParagraphCxSpMiddle" style="line-height: normal; margin-bottom: 0.0001pt; text-indent: -0.25in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;5.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Better integral literals,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoListParagraphCxSpLast" style="line-height: normal; margin-bottom: 0.0001pt; text-indent: -0.25in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;6.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;&amp;nbsp;Improved exception handling (multi-catch)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h1&gt;Core&lt;o:p&gt;&lt;/o:p&gt;&lt;/h1&gt;&lt;h2&gt;Upgrade class-loader architecture&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Modifications to the ClassLoader API and implementation to avoid deadlocks in non-hierarchical class-loader topologies&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;Method to close a URLClassLoader&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;A method that frees the underlying resources, such as open files, held by a URLClassLoader&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;Concurrency and collections updates (jsr166y)&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;A lightweight fork/join framework, flexible and reusable synchronization barriers, transfer queues, a concurrent-reference HashMap, and thread-local pseudo-random number generators&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;h1&gt;Internationalization&lt;o:p&gt;&lt;/o:p&gt;&lt;/h1&gt;&lt;h2&gt;Unicode 6.0&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Upgrade the supported version of Unicode to 6.0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;Locale enhancement&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Upgrade the java.util.Locale class to support IETF BCP 47 and UTR 35 (CLDR/LDML)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;Separate user locale and user-interface locale&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Upgrade the handling of locales to separate formatting locales from user-interface language locales, as is done on Vista and later versions of Windows&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h1&gt;I/O and Networking&lt;o:p&gt;&lt;/o:p&gt;&lt;/h1&gt;&lt;h2&gt;JSR 203: More new I/O APIs for the Java platform (NIO.2)&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;New APIs for filesystem access, scalable asynchronous I/O operations, socket-channel binding and configuration, and multicast datagrams&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;h2&gt;NIO.2 filesystem provider for zip/jar archives&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;A fully-functional and supported NIO.2 filesystem provider for zip and jar files&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;SCTP (Stream Control Transmission Protocol)&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;An implementation-specific API for the Stream Control Transmission Protocol on Solaris&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;SDP (Sockets Direct Protocol)&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Implementation-specific support for reliable, high-performance network streams over Infiniband connections on Solaris and Linux&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;Use the Windows Vista IPv6 stack&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Upgrade the networking code to use the Windows Vista IPv6 stack, when available, in preference to the legacy Windows stack&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;h2&gt;TLS 1.2&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Add support for TLS 1.2, which was standardized in 2008 as RFC 5246&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h1&gt;Security &amp;amp; Cryptography&lt;o:p&gt;&lt;/o:p&gt;&lt;/h1&gt;&lt;h2&gt;Elliptic-curve cryptography (ECC)&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;A portable implementation of the standard Elliptic Curve Cryptographic (ECC) algorithms, so that all Java applications can use ECC out-of-the-box&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h1&gt;JDBC&lt;o:p&gt;&lt;/o:p&gt;&lt;/h1&gt;&lt;h2&gt;JDBC 4.1&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Upgrade to JDBC 4.1 and Rowset 1.1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h1&gt;Client&lt;o:p&gt;&lt;/o:p&gt;&lt;/h1&gt;&lt;h2&gt;XRender pipeline for Java 2D&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;A new Java2D graphics pipeline based upon the X11 XRender extension, which provides access to much of the functionality of modern GPUs&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;Create new platform APIs for 6u10 graphics features&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Create new platform APIs for features originally implemented in the&amp;nbsp;6u10 release: Translucent and shaped windows, heavyweight/lightweight mixing, and the improved AWT security warning&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;Nimbus look-and-feel for Swing&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;A next-generation cross-platform look-and-feel for Swing&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;Swing JLayer component&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Add the SwingLabs JXLayer component decorator to the platform&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h1&gt;Web&lt;o:p&gt;&lt;/o:p&gt;&lt;/h1&gt;&lt;h2&gt;Update the XML stack&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Upgrade the JAXP, JAXB, and JAX-WS APIs to the most recent stable versions&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;h1&gt;Management&lt;o:p&gt;&lt;/o:p&gt;&lt;/h1&gt;&lt;h2&gt;Enhanced JMX Agent and MBeans [NEW]&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;An implementation-specific enhanced JMX management agent, ported from JRockit, which makes it easier to connect to the platform MBean server through firewalls, together with a richer set of MBeans which expose additional information about the internal operation of the VM&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h1&gt;Deferred to JDK 8 or later&lt;o:p&gt;&lt;/o:p&gt;&lt;/h1&gt;&lt;h2&gt;JSR 294: Language and VM support for modular programming&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Enhancements to the Java language and virtual-machine specifications to support modular programming, at both compile time and run time&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;JSR 308: Annotations on Java types&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;An extension to the Java annotation syntax to permit annotations on any occurrence of a type&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;JSR TBD: Language support for collections&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Literal expressions for immutable lists, sets, and maps, and indexing-access syntax for lists and maps&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;JSR TBD: Project Lambda&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Lambda expressions (informally, "closures") and defender methods for the Java programming language&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;Modularization (Project Jigsaw)&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;A simple, low-level module system focused upon the goal of modularizing the JDK, and the application of that system to the JDK itself&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;JSR 296: Swing application framework&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;An API to define the basic structure of a typical Swing application, thereby eliminating lots of boilerplate code and providing a much-improved initial developer experience&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;Swing JDatePicker component&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Add the SwingLabs JXDatePicker component to the platform&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Courtesy:&lt;/b&gt; &lt;a href="http://openjdk.java.net/projects/jdk7/features/#f353"&gt;http://openjdk.java.net/projects/jdk7/features/#f353&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/7207673864308951781/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2011/03/java-7-features.html#comment-form" rel="replies" title="1 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/7207673864308951781" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/7207673864308951781" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2011/03/java-7-features.html" rel="alternate" title="JAVA 7 Features" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-7186116461672999050</id><published>2010-06-03T14:23:00.001+05:30</published><updated>2010-06-03T14:32:31.211+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Core Java"/><category scheme="http://www.blogger.com/atom/ns#" term="multithreading"/><title type="text">Singleton - Multiple Users [Thread Safe]</title><content type="html">Following is the way by which we can use Singleton Design pattern for multiple users.  &lt;br /&gt;
&lt;br /&gt;
public class Singleton {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private &lt;b&gt;volatile &lt;/b&gt;static Singleton singleton; //volatile is needed so that multiple thread can reconcile the instance&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private Singleton(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static Singleton getSingleton(){ //synchronized keyword has been removed from here&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(singleton = = null)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //needed because once there is singleton available no need to aquire monitor again &amp;amp; again as it is costly&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &lt;b&gt;synchronized(Singleton.class)&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; //this is needed if two threads are waiting at the monitor at the time when singleton was getting instantiated &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(singleton==null)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &amp;nbsp;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; singleton= new Singleton();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; } &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return singleton;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/7186116461672999050/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/06/singleton-multiple-users-thread-safe.html#comment-form" rel="replies" title="1 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/7186116461672999050" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/7186116461672999050" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/06/singleton-multiple-users-thread-safe.html" rel="alternate" title="Singleton - Multiple Users [Thread Safe]" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-4137510627848327880</id><published>2010-05-13T14:48:00.001+05:30</published><updated>2010-05-13T14:49:37.537+05:30</updated><title type="text">wait(), notify() and notifyAll()</title><content type="html">The &lt;b&gt;wait(), notify() and notifyAll()&lt;/b&gt; methods are used to provide an efficient way for threads to &lt;b&gt;wait for a shared resource&lt;/b&gt;. When a thread executes an object's wait() method, it enters the waiting state. It only enters the ready state after another thread invokes the object's notify() or notifyAll() methods.&lt;br /&gt;
&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/4137510627848327880/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/05/wait-notify-and-notifyall.html#comment-form" rel="replies" title="2 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/4137510627848327880" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/4137510627848327880" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/05/wait-notify-and-notifyall.html" rel="alternate" title="wait(), notify() and notifyAll()" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-3771487289582996200</id><published>2010-05-10T12:29:00.000+05:30</published><updated>2010-05-10T12:29:24.251+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="multithreading"/><category scheme="http://www.blogger.com/atom/ns#" term="volatile"/><title type="text">Volatile Modifiers in Java</title><content type="html">&lt;b&gt;Volatile Modifier&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The volatile modifier requests the Java Virtual Machine to always access the shared copy of the variable so the its &lt;b&gt;most current value&lt;/b&gt; is always read. If two or more threads access a member variable, and one or more threads might update that variable’s value, and all of the threads &lt;b&gt;do not use synchronization&lt;/b&gt; to read and/or write the variable value, then that member variable must be declared volatile to ensure all threads should get the updated value.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; We will discuss the java volatile modifier using following example. &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In our example, we take two threads Thread T1 and Thread T2 accessing member variable x of class C and here Thread T1 is not using synchronization and Thread T2 uses synchronization. If Thread T2 updates value of variable x from 0 to 1. But if the variable x is not declared as volatile then meanwhile Thread T1 tried to access variable then it will get value of variable x as 0. But as variable x is updated to 1 by Thread T2, To avoid this mess the variable x should be declared as volatile so Thread T1 should get updated value 1.&lt;br /&gt;
&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/3771487289582996200/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/05/volatile-modifiers-in-java.html#comment-form" rel="replies" title="1 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/3771487289582996200" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/3771487289582996200" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/05/volatile-modifiers-in-java.html" rel="alternate" title="Volatile Modifiers in Java" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-7785545305309644880</id><published>2010-05-06T12:46:00.001+05:30</published><updated>2010-05-10T12:30:41.164+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Collections"/><category scheme="http://www.blogger.com/atom/ns#" term="ConcurrentHashMap"/><category scheme="http://www.blogger.com/atom/ns#" term="HashMap"/><title type="text">HashMap vs ConcurrentHashMap</title><content type="html">Both HashMap and ConcurrentHashMap are inherits some characteristics of Hashtable. But they have some prominent differences in context with performance, scalability.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;HashMap&lt;/b&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Since Java 1.2 &lt;/li&gt;
&lt;li&gt;Allows null key and value&lt;/li&gt;
&lt;li&gt;Poor performance in highly threaded applications&lt;/li&gt;
&lt;li&gt;Not much scalable&lt;/li&gt;
&lt;li&gt;Throws a ConcurrentModificationException&lt;/li&gt;
&lt;li&gt;Faster in non-multi threading applications&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;b&gt;ConcurrentHashMap&lt;/b&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Since Java 1.5&lt;/li&gt;
&lt;li&gt;Doesn't allow null key or value&lt;/li&gt;
&lt;li&gt;Better performance in Highly threaded applications&lt;/li&gt;
&lt;li&gt;Highly scalable&lt;/li&gt;
&lt;li&gt;Do not throw ConcurrentModificationException&lt;/li&gt;
&lt;li&gt;Slower in non-multi threading applications &lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/7785545305309644880/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/05/hashmap-vs-concurrenthashmap.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/7785545305309644880" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/7785545305309644880" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/05/hashmap-vs-concurrenthashmap.html" rel="alternate" title="HashMap vs ConcurrentHashMap" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-3387644530336380349</id><published>2010-05-05T10:33:00.001+05:30</published><updated>2010-05-10T12:39:33.186+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Core Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Properties"/><title type="text">Read value from Java properties</title><content type="html">Here, you will find the source code to read value of the key from properties file. java.util.Properties class extends Hashtable. Properties class creates the properties file which stores key - value pair using Hashtable. To retrieve value from properties file we have to follow following steps.&lt;br /&gt;
&lt;ol&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3B9itLg4SFgbE4Ix01Mr8KvZSnc-zzQKdvSVZZabsFiynetsae3hWpHjZhjcsyVDnoEBpSKTdeIiaclzeqEPT22cidRYaHnf5emRk7Qe7zXPU4MZppNLv92ZU1iGdiJVEOu892rALe0Yy/s1600/testproperties.PNG" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" height="114" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3B9itLg4SFgbE4Ix01Mr8KvZSnc-zzQKdvSVZZabsFiynetsae3hWpHjZhjcsyVDnoEBpSKTdeIiaclzeqEPT22cidRYaHnf5emRk7Qe7zXPU4MZppNLv92ZU1iGdiJVEOu892rALe0Yy/s200/testproperties.PNG" width="200" /&gt;&lt;/a&gt;
&lt;li&gt;Create an object of Properties class.&lt;/li&gt;
&lt;li&gt;Load properties file using FileInputStream into properties object.&lt;/li&gt;
&lt;li&gt;Get value from properties object using getProperty() method passing key as an input.&lt;/li&gt;
&lt;/ol&gt;The below code will help to understand more...&lt;br /&gt;
&lt;br /&gt;
import java.io.FileInputStream;&lt;br /&gt;
import java.io.FileNotFoundException;&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import java.util.Properties;&lt;br /&gt;
&lt;br /&gt;
public class PropertiesReadTest {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void main(String[] args) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Properties properties = new Properties();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; properties.load(new FileInputStream("C:\\temp\\test.properties"));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; String value = properties.getProperty("key");&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println("Value = " + value);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (FileNotFoundException e) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; e.printStackTrace();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (IOException e) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; e.printStackTrace();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Output is shown here in following image&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpDiFu0I28GHDFNAWEZc-oh9NfB_Xt6SHyci9-hk3OT1Jvw2tzBBYllTbBh1KLoJ1ypI8rdvpw8s-4l0fjltaHAA0ceqgUJpFdbAJFcTYoiFOUnTC72RQSdTwtwwmdBgGkEi3brCdFZbLY/s1600/properties_output.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpDiFu0I28GHDFNAWEZc-oh9NfB_Xt6SHyci9-hk3OT1Jvw2tzBBYllTbBh1KLoJ1ypI8rdvpw8s-4l0fjltaHAA0ceqgUJpFdbAJFcTYoiFOUnTC72RQSdTwtwwmdBgGkEi3brCdFZbLY/s320/properties_output.PNG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/3387644530336380349/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/05/read-value-from-java-properties.html#comment-form" rel="replies" title="2 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/3387644530336380349" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/3387644530336380349" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/05/read-value-from-java-properties.html" rel="alternate" title="Read value from Java properties" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3B9itLg4SFgbE4Ix01Mr8KvZSnc-zzQKdvSVZZabsFiynetsae3hWpHjZhjcsyVDnoEBpSKTdeIiaclzeqEPT22cidRYaHnf5emRk7Qe7zXPU4MZppNLv92ZU1iGdiJVEOu892rALe0Yy/s72-c/testproperties.PNG" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-6018040878585873154</id><published>2010-05-04T18:34:00.002+05:30</published><updated>2010-05-10T12:41:24.801+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Core Java"/><title type="text">Source code to read content of File</title><content type="html">Here you will find the source code to read the content of file.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Steps&lt;/b&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt; Create the FileReader object using file name as an input to  FileReader constructor.&lt;/li&gt;
&lt;li&gt;Pass that FileReader object to BufferedReader.&lt;/li&gt;
&lt;li&gt;Read the line from BufferedReader object till readline gets null.&lt;/li&gt;
&lt;/ol&gt;import java.io.BufferedReader;&lt;br /&gt;
import java.io.File;&lt;br /&gt;
import java.io.FileNotFoundException;&lt;br /&gt;
import java.io.FileReader;&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
&lt;br /&gt;
public class FileReadTest {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void main(String[] args) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;try {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; BufferedReader br = new BufferedReader(new FileReader("C:\\temp\\test.txt"));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; String line = ""; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; while((line = br.readLine()) != null)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(line);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (FileNotFoundException e) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; e.printStackTrace();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (IOException e) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; e.printStackTrace();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/6018040878585873154/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/05/code-to-read-content-of-file.html#comment-form" rel="replies" title="1 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/6018040878585873154" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/6018040878585873154" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/05/code-to-read-content-of-file.html" rel="alternate" title="Source code to read content of File" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-6435894360790794061</id><published>2010-05-03T15:14:00.003+05:30</published><updated>2010-05-10T14:25:22.160+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="jsp"/><category scheme="http://www.blogger.com/atom/ns#" term="servlet"/><title type="text">Access file using JSP &amp; Servlets</title><content type="html">Given source code used for accessing file from server using &lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
Servlets&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
String path = &lt;b&gt;getServletContext( ).&lt;/b&gt;getRealPath ("xyz.xml"  ) ; &lt;br /&gt;
System.out.println (   path  ) ; &lt;br /&gt;
File file = new File (  path  ) ; &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;JSP&lt;/b&gt;&lt;br /&gt;
String path = &lt;b&gt;application.&lt;/b&gt;getRealPath ("xyz.xml"  ) ; &lt;br /&gt;
System.out.println (   path  ) ; &lt;br /&gt;
File file = new File (  path  ) ; &lt;br /&gt;
&lt;br /&gt;
In above jsp code, "application" is jsp implicit object.&lt;br /&gt;
&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/6435894360790794061/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/05/access-file-using-jsp-servlets.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/6435894360790794061" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/6435894360790794061" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/05/access-file-using-jsp-servlets.html" rel="alternate" title="Access file using JSP &amp; Servlets" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-4173465951941601498</id><published>2010-04-30T11:06:00.001+05:30</published><updated>2010-05-10T12:49:02.929+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Core Java"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type="text">Java pass by value or pass by reference</title><content type="html">&lt;ul&gt;&lt;li&gt;Java manipulates objects by reference, and all object variables are references. However, Java &lt;b&gt;doesn't pass method arguments by reference&lt;/b&gt;; it passes them &lt;b&gt;by value&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Java is &lt;b&gt;&lt;i&gt;strictly&lt;/i&gt;&lt;/b&gt; pass-by-value, exactly as in C.&lt;/li&gt;
&lt;li&gt;Java &lt;b&gt;&lt;i&gt;has&lt;/i&gt;&lt;/b&gt; pointers and is strictly pass-by-value. &lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/4173465951941601498/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/java-pass-by-value-or-pass-by-reference.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/4173465951941601498" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/4173465951941601498" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/java-pass-by-value-or-pass-by-reference.html" rel="alternate" title="Java pass by value or pass by reference" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-3411005795819034300</id><published>2010-04-29T18:42:00.001+05:30</published><updated>2010-05-10T14:24:46.410+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Core Java"/><category scheme="http://www.blogger.com/atom/ns#" term="OOPs Concepts"/><title type="text">Encapsulation in JAVA</title><content type="html">&lt;b&gt;Encapsulation&lt;/b&gt; in java means declare instance variables of class as private and access that instance variables using public methods.&lt;br /&gt;
Following is the example which shows that Person class having name and age are private instance variables and those are accessed by public getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
public class Person {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private String name;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private int age;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public String getName() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return name;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void setName(String name) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; this.name = name;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public int getAge() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return age;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void setAge(int age) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; this.age = age;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/3411005795819034300/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/encapsulation-in-java.html#comment-form" rel="replies" title="3 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/3411005795819034300" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/3411005795819034300" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/encapsulation-in-java.html" rel="alternate" title="Encapsulation in JAVA" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-7262643200794356395</id><published>2010-04-29T18:31:00.002+05:30</published><updated>2010-05-10T14:26:14.375+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Core Java"/><category scheme="http://www.blogger.com/atom/ns#" term="OOPs Concepts"/><title type="text">OOPs concepts in JAVA</title><content type="html">&lt;ul&gt;&lt;li&gt;&lt;b&gt;Abstraction:&lt;/b&gt; Hides certain details and only show the essential features of the object. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;Encapsulation: &lt;/b&gt;The internal representation of an object is generally hidden from view outside of the object's definition.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Inheritance:&lt;/b&gt; Defines relationships among classes in an object-oriented language. &lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Polymorphism:&lt;/b&gt; Define more than one method with the same name.&lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;/ul&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/7262643200794356395/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/oops-concepts-in-java.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/7262643200794356395" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/7262643200794356395" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/oops-concepts-in-java.html" rel="alternate" title="OOPs concepts in JAVA" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-6486693455862401724</id><published>2010-04-29T18:04:00.001+05:30</published><updated>2010-05-10T14:27:08.103+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Core Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Exception Handling"/><title type="text">finally block not executed</title><content type="html">Finally block is always executed except some of the following cases.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;If the&lt;b&gt; JVM exits&lt;/b&gt; while the &lt;code&gt;try&lt;/code&gt; or &lt;code&gt;catch&lt;/code&gt; code is being executed, then the &lt;code&gt;finally&lt;/code&gt; block may not execute.&amp;nbsp; &lt;/li&gt;
&lt;/ul&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.g. System.exit(0);&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;If the&lt;b&gt; thread executing the &lt;code&gt;try&lt;/code&gt; or &lt;code&gt;catch&lt;/code&gt; code is interrupted or killed,&lt;/b&gt; the &lt;code&gt;finally&lt;/code&gt; block may not execute even though the application as a whole continues.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; e.g. Thread.interrupted(); &lt;br /&gt;
&lt;br /&gt;
&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/6486693455862401724/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/finally-block-not-executed.html#comment-form" rel="replies" title="1 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/6486693455862401724" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/6486693455862401724" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/finally-block-not-executed.html" rel="alternate" title="finally block not executed" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-4209915912513197205</id><published>2010-04-29T17:54:00.001+05:30</published><updated>2010-05-10T14:38:50.135+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="J2EE"/><title type="text">J2EE Design Patterns</title><content type="html">&lt;ol&gt;&lt;li&gt;Business Delegate&lt;/li&gt;
&lt;li&gt;Composite Entity&lt;/li&gt;
&lt;li&gt;Composite View&lt;/li&gt;
&lt;li&gt;Data Access Object (DAO)&lt;/li&gt;
&lt;li&gt;Fast Lane Reader&lt;/li&gt;
&lt;li&gt;Front Controller&lt;/li&gt;
&lt;li&gt;Intercepting Filter&lt;/li&gt;
&lt;li&gt;Model-View-Controller&lt;/li&gt;
&lt;li&gt;Service Locator&lt;/li&gt;
&lt;li&gt;Session Facade&lt;/li&gt;
&lt;li&gt;Transfer Object&lt;/li&gt;
&lt;li&gt;Value List Handler&lt;/li&gt;
&lt;li&gt;View Helper &lt;span class="body"&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/4209915912513197205/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/j2ee-design-patterns.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/4209915912513197205" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/4209915912513197205" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/j2ee-design-patterns.html" rel="alternate" title="J2EE Design Patterns" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-654561631990673648</id><published>2010-04-20T18:56:00.000+05:30</published><updated>2010-04-20T18:56:08.941+05:30</updated><title type="text">Static vs Transient variables</title><content type="html">&lt;b&gt;Static variables&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Static variables are class variables.&lt;/li&gt;
&lt;li&gt;Static variables can be serialized.&lt;/li&gt;
&lt;li&gt;static modifier applies to static variables.&lt;/li&gt;
&lt;/ul&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; class TestClass{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static int testVariable;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; . . .&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Transient variables&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Transient variables are member or instance variables of class.&lt;/li&gt;
&lt;li&gt;Transient variables can not be serialized.&lt;/li&gt;
&lt;li&gt;transient modifier applies to transient variables.&lt;/li&gt;
&lt;/ul&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; class TestClass{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; transient int testVariable;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; . . .&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/654561631990673648/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/static-vs-transient-variables.html#comment-form" rel="replies" title="12 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/654561631990673648" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/654561631990673648" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/static-vs-transient-variables.html" rel="alternate" title="Static vs Transient variables" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-7667871015972184659</id><published>2010-04-15T14:59:00.003+05:30</published><updated>2010-04-15T15:05:39.362+05:30</updated><title type="text">JDK 5 Enhancements in Java Language</title><content type="html">&lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type"&gt;&lt;/meta&gt;&lt;meta content="Word.Document" name="ProgId"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 12" name="Generator"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 12" name="Originator"&gt;&lt;/meta&gt;&lt;link href="file:///C:%5CDOCUME%7E1%5Csharad.j%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;/link&gt;&lt;link href="file:///C:%5CDOCUME%7E1%5Csharad.j%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx" rel="themeData"&gt;&lt;/link&gt;&lt;link href="file:///C:%5CDOCUME%7E1%5Csharad.j%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml" rel="colorSchemeMapping"&gt;&lt;/link&gt;    &lt;m:smallfrac m:val="off"&gt;    &lt;m:dispdef&gt;    &lt;m:lmargin m:val="0"&gt;    &lt;m:rmargin m:val="0"&gt;    &lt;m:defjc m:val="centerGroup"&gt;    &lt;m:wrapindent m:val="1440"&gt;    &lt;m:intlim m:val="subSup"&gt;    &lt;m:narylim m:val="undOvr"&gt;   &lt;/m:narylim&gt;&lt;/m:intlim&gt; &lt;/m:wrapindent&gt;&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-1610611985 1073750139 0 0 159 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-priority:1;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:"";
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:0in;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:"Times New Roman";
	mso-fareast-theme-font:minor-fareast;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
code
	{mso-style-noshow:yes;
	mso-style-priority:99;
	font-family:"Courier New";
	mso-ascii-font-family:"Courier New";
	mso-fareast-font-family:"Times New Roman";
	mso-hansi-font-family:"Courier New";
	mso-bidi-font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
	{mso-style-priority:34;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:.5in;
	mso-add-space:auto;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:"Times New Roman";
	mso-fareast-theme-font:minor-fareast;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst
	{mso-style-priority:34;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-type:export-only;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:.5in;
	margin-bottom:.0001pt;
	mso-add-space:auto;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:"Times New Roman";
	mso-fareast-theme-font:minor-fareast;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle
	{mso-style-priority:34;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-type:export-only;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:.5in;
	margin-bottom:.0001pt;
	mso-add-space:auto;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:"Times New Roman";
	mso-fareast-theme-font:minor-fareast;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast
	{mso-style-priority:34;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-type:export-only;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:.5in;
	mso-add-space:auto;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:"Times New Roman";
	mso-fareast-theme-font:minor-fareast;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	mso-bidi-font-size:10.0pt;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:"Times New Roman";
	mso-fareast-theme-font:minor-fareast;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
.MsoPapDefault
	{mso-style-type:export-only;
	margin-bottom:10.0pt;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
 /* List Definitions */
 @list l0
	{mso-list-id:500433550;
	mso-list-type:hybrid;
	mso-list-template-ids:505039716 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
	{mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
--&gt;
&lt;/style&gt;  &lt;/m:defjc&gt;&lt;/m:rmargin&gt;&lt;/m:lmargin&gt;&lt;/m:dispdef&gt;&lt;/m:smallfrac&gt;&lt;br /&gt;
&lt;div class="MsoListParagraph" style="margin-bottom: 0.0001pt; text-indent: -0.25in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;1.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Generics &lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;- This is an enhancement to the type system allows a type or method to operate on objects of various types while providing compile-time type safety. It adds compile-time type safety to the Collections Framework and eliminates the drudgery of casting.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;e.g. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Previously&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Array List numbers = new ArrayList();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Now in JDK 5.0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Array List&amp;lt;Integer&amp;gt; numbers = new ArrayList&amp;lt;Integer&amp;gt; ();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoListParagraph" style="margin-bottom: 0.0001pt; text-indent: -0.25in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;2.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Enhanced for Loop&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; - This new language construct eliminates the drudgery and error-proneness of iterators and index variables when iterating over collections and arrays.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;e.g. &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Previously&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;code&gt;&lt;span style="color: black; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Iterator&amp;nbsp;itr&amp;nbsp;=&amp;nbsp;numbers.iterator();&lt;/span&gt;&lt;/code&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;
while&lt;/span&gt;&lt;code&gt;&lt;b&gt;&lt;span style="color: #7f0055; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="color: black; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;(itr.hasNext())&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;code&gt;&lt;span style="color: black; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;{&lt;/span&gt;&lt;/code&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;code&gt;&lt;span style="color: white; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="color: black; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Integer&amp;nbsp;element&amp;nbsp;=&amp;nbsp;(Integer)itr.next();&lt;/span&gt;&lt;/code&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;code&gt;&lt;span style="color: white; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;System.out.println (number);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;code&gt;&lt;span style="color: black; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Now in JDK 5.0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;for (Integer number: numbers)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println (number);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoListParagraph" style="margin-bottom: 0.0001pt; text-indent: -0.25in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;3.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Autoboxing/Unboxing&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; - This facility eliminates the drudgery of manual conversion between primitive types (such as int, long) and wrapper types (such as Integer, Long).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;e.g.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;int number = 1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Previously&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Integer number2 = (Integer) number;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Now in JDK 5.0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Integer number2 = number;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoListParagraph" style="margin-bottom: 0.0001pt; text-indent: -0.25in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;4.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Typesafe Enums&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; - This flexible object-oriented enumerated type facility allows you to create enumerated types with arbitrary methods and fields. It provides all the benefits of the Typesafe Enum pattern ("Effective Java," Item 21) without the verbosity and the error-proneness. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;e.g.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Previously&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;public static final int SEASON_WINTER = 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;public static final int SEASON_SPRING = 1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;public static final int SEASON_SUMMER = 2;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;public static final int SEASON_FALL&amp;nbsp;&amp;nbsp; = 3;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Now in JDK 5.0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;enum Season {WINTER, SPRING, SUMMER, FALL}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoListParagraph" style="margin-bottom: 0.0001pt; text-indent: -0.25in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;5.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Varargs&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; - This facility eliminates the need for manually boxing up argument lists into an array when invoking methods that accept variable-length argument lists. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;e.g.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Previously&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Object[] arguments = {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; new Integer(7),&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; new Date(),&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "a disturbance in the Force"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;String result = MessageFormat.forma("At {1,time} on {1,date}, there was {2} on planet "&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + "{0,number,integer}.", arguments);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Now in JDK 5.0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Using Varargs no need to create object array separately, we can give arguments directy.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;String result = MessageFormat.format("At {1,time} on {1,date}, there was {2} on planet "&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; + "{0,number,integer}.",&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;7, new Date(), "a disturbance in the Force");&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoListParagraphCxSpFirst" style="margin-bottom: 0.0001pt; text-indent: -0.25in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;6.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Static Import&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; - This facility lets you avoid qualifying static members with class names without the shortcomings of the "Constant Interface antipattern." &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoListParagraphCxSpLast" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;e.g.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Previously&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;double r = &lt;span style="color: #cc0000;"&gt;Math.&lt;/span&gt;cos(&lt;span style="color: #cc0000;"&gt;Math.&lt;/span&gt;PI * theta);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Now in JDK 5.0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;import static java.lang.Math.*;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Once the static members have been imported, they may be used without qualification or class names: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;double r = cos(PI * theta);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoListParagraph" style="margin-bottom: 0.0001pt; text-indent: -0.25in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;7.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Annotations (Metadata)&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; - This language feature lets you avoid writing boilerplate code under many circumstances by enabling tools to generate it from annotations in the source code. This leads to a "declarative" programming style where the programmer says what should be done and tools emit the code to do it. Also it eliminates the need for maintaining "side files" that must be kept up to date with changes in source files. Instead the information can be maintained &lt;i&gt;in&lt;/i&gt; the source file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Now in JDK 5.0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;public @ interface Test{}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span xmlns=""&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span xmlns=""&gt;&lt;/span&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/7667871015972184659/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/jdk-5-enhancements-in-java-language.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/7667871015972184659" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/7667871015972184659" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/jdk-5-enhancements-in-java-language.html" rel="alternate" title="JDK 5 Enhancements in Java Language" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-4834218048552005606</id><published>2010-04-14T17:46:00.001+05:30</published><updated>2010-05-10T14:38:01.375+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Collections"/><category scheme="http://www.blogger.com/atom/ns#" term="Core Java"/><category scheme="http://www.blogger.com/atom/ns#" term="HashMap"/><title type="text">Retrieve key from HashMap using value</title><content type="html">Below is the code to retrieve the key from HashMap using value &lt;br /&gt;
import java.util.HashMap;&lt;br /&gt;
import java.util.Map;&lt;br /&gt;
import java.util.Set;&lt;br /&gt;
import java.util.Map.Entry;&lt;br /&gt;
&lt;br /&gt;
public class TestClass {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void main(String[] args) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Map&amp;lt;Integer, Person&amp;gt; people = new HashMap&amp;lt;Integer, Person&amp;gt;();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Person person1 = new Person();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; person1.setName("Mack");&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; person1.setPost("Dev");&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Person person2 = new Person();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; person2.setName("John");&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; person2.setPost("Dev");&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; people.put(1, person1);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; people.put(2, person2);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Set&amp;lt;Entry&amp;lt;Integer, Person&amp;gt;&amp;gt; peopleSet = people.entrySet();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; for (Entry&amp;lt;Integer, Person&amp;gt; entry : peopleSet) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Integer key = entry.getKey();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Person value = entry.getValue();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if (value.equals(person2)) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println("Key = " + key);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/4834218048552005606/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/key-from-hashmap-using-value.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/4834218048552005606" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/4834218048552005606" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/key-from-hashmap-using-value.html" rel="alternate" title="Retrieve key from HashMap using value" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-948382960410927570</id><published>2010-04-13T18:04:00.003+05:30</published><updated>2010-05-10T14:27:42.833+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="servlet"/><title type="text">Servlet Chaining</title><content type="html">&lt;b&gt;Servlet Chaining&lt;/b&gt; means the output of one servlet given as a input to another servlet. Servlet  Aliasing allows us to invoke more than one servlet in sequence when the  URL is opened with a common servlet alias. The output from first Servlet  is sent as input to other Servlet and so on. The Output from the last  Servlet is sent back to the browser. The entire process is called &lt;b&gt;Servlet Chaining.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
How to do Servlet Chaining in Servlet Programming?&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Using include&lt;/b&gt;&lt;br /&gt;
RequestDispatcher rd = req.getRequestDispatcher("SecondServlet");&lt;code&gt;&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;rd.include(request, response);&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Using forward&lt;/b&gt;&lt;br /&gt;
&lt;code&gt;&lt;/code&gt;RequestDispatcher rd = req.getRequestDispatcher("SecondServlet");&lt;code&gt;&lt;/code&gt;&lt;code&gt;&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;rd.&lt;/code&gt;&lt;code&gt;forward(request, response);&lt;/code&gt;&lt;br /&gt;
&lt;pre&gt;&lt;/pre&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/948382960410927570/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/servlet-chaining.html#comment-form" rel="replies" title="2 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/948382960410927570" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/948382960410927570" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/servlet-chaining.html" rel="alternate" title="Servlet Chaining" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-7143655271373587423</id><published>2010-04-12T17:41:00.000+05:30</published><updated>2010-04-12T17:41:57.811+05:30</updated><title type="text">JDBC driver types</title><content type="html">JDBC drivers are divided into four types.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Type 1: JDBC-ODBC Bridge&lt;/li&gt;
&lt;li&gt;Type 2: Native-API/partly Java driver&lt;/li&gt;
&lt;li&gt;Type 3: Net-protocol/all-Java driver&lt;/li&gt;
&lt;li&gt;Type 4: Native-protocol/all-Java driver&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/7143655271373587423/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/jdbc-driver-types.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/7143655271373587423" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/7143655271373587423" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/jdbc-driver-types.html" rel="alternate" title="JDBC driver types" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-967789271910978496</id><published>2010-04-12T17:24:00.001+05:30</published><updated>2010-04-12T17:32:25.206+05:30</updated><title type="text">Java Database Connectivity (JDBC)</title><content type="html">JDBC is Java Database Connectivity helps to write java applications using databases.&lt;br /&gt;
&lt;br /&gt;
Steps to use JDBC in java applications as follows&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Load the JDBC driver. &lt;/li&gt;
&lt;li&gt;Define the connection URL. &lt;/li&gt;
&lt;li&gt;Establish the connection. &lt;/li&gt;
&lt;li&gt;Create a statement object. &lt;/li&gt;
&lt;li&gt;Execute a query or update. &lt;/li&gt;
&lt;li&gt;Process the results. &lt;/li&gt;
&lt;li&gt;Close the connection.&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;try {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Class.forName("driveClassName");&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Connection con = DriverManager.getConnection(&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; "jdbc:driveName:databaseName", "login", "password");&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Statement stmt = con.createStatement();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ResultSet rs = stmt.executeQuery("SELECT * FROM Table");&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; while (rs.next()) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; int a = rs.getInt("column1");&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; String b = rs.getString("column2");&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; float c = rs.getFloat("column3");&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (SQLException e) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; e.printStackTrace();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (ClassNotFoundException e) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; e.printStackTrace();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } finally {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // close the connection&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;pre&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/967789271910978496/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/java-database-connectivity-jdbc.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/967789271910978496" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/967789271910978496" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/java-database-connectivity-jdbc.html" rel="alternate" title="Java Database Connectivity (JDBC)" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-4336506254248208639</id><published>2010-04-12T12:29:00.004+05:30</published><updated>2010-05-10T14:39:54.152+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Core Java"/><title type="text">Serialization and Deserialization</title><content type="html">&lt;ol&gt;&lt;li&gt;Serialization is the process of transforming an &lt;i&gt;in-memory object to a byte stream&lt;/i&gt;.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;An object is serialized by writing it to an &lt;b&gt;ObjectOutputStream&lt;/b&gt;.&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Serialization Code&lt;/b&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileOutputStream out =   new FileOutputStream("test.txt" );&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ObjectOutputStream oos =     new ObjectOutputStream( out );&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oos.writeObject(new String ());&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oos.close ();&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Deserialization is the inverse process of &lt;i&gt;reconstructing an object from a byte stream to the same state in which the object&lt;/i&gt; was previously serialized.&lt;span xmlns=""&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span xmlns=""&gt;An object is deserialized by reading it from an &lt;b&gt;ObjectInputStream&lt;/b&gt;&lt;/span&gt;&lt;span xmlns=""&gt;&lt;b&gt;. &lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span xmlns=""&gt;&lt;b&gt;Deserialization Code&lt;/b&gt;&lt;/span&gt;&lt;span xmlns=""&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div style="margin-left: 36pt;"&gt;&lt;span xmlns=""&gt;FileInputStream in =     new FileInputStream( "test.txt" );&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-left: 36pt;"&gt;&lt;span xmlns=""&gt;ObjectInputStream ois =   new ObjectInputStream( in );&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-left: 36pt;"&gt;&lt;span xmlns=""&gt;String s = (String) ois.readObject();&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-left: 36pt;"&gt;&lt;span xmlns=""&gt;ois.close(); &lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;span xmlns=""&gt;&lt;/span&gt;&lt;br /&gt;
&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/4336506254248208639/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/serialization-and-deserialization.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/4336506254248208639" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/4336506254248208639" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/serialization-and-deserialization.html" rel="alternate" title="Serialization and Deserialization" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-8904207934075183794</id><published>2010-04-12T11:48:00.001+05:30</published><updated>2010-04-12T11:48:26.892+05:30</updated><title type="text">JAR WAR and EAR Files</title><content type="html">&lt;span xmlns=''&gt;&lt;p&gt;&lt;span style='font-family:Times New Roman; font-size:12pt'&gt;&lt;strong&gt;JAR Files (Java Archive):&lt;/strong&gt;&lt;br /&gt;				&lt;/span&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;span style='font-family:Times New Roman; font-size:12pt'&gt;These files are with the .jar extension. &lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style='font-family:Times New Roman; font-size:12pt'&gt;The .jar files contain the classes, libraries, resources and accessories files like property files. &lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;span style='font-family:Times New Roman; font-size:12pt'&gt;&lt;strong&gt;WAR Files (Web Archive):&lt;/strong&gt;&lt;br /&gt;				&lt;/span&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;span style='font-family:Times New Roman; font-size:12pt'&gt;These files are with the .war extension. &lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style='font-family:Times New Roman; font-size:12pt'&gt;The war file contains JSP, html, JavaScript and other files for necessary for the development of web applications.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style='font-family:Times New Roman; font-size:12pt'&gt;The war file contains the web application that can be deployed on the any servlet/jsp container. &lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;span style='font-family:Times New Roman; font-size:12pt'&gt;&lt;strong&gt;EAR Files:&lt;/strong&gt;&lt;br /&gt;				&lt;/span&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;span style='font-family:Times New Roman; font-size:12pt'&gt;These files are with the .ear extension. &lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style='font-family:Times New Roman; font-size:12pt'&gt;The .ear file contains the EJB modules of the applications.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style='font-family:Times New Roman; font-size:12pt'&gt;The ear file contains the ejb application that can be deployed on the any application server with ejb container.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;span style='font-family:Times New Roman; font-size:12pt'&gt;&lt;br /&gt;				&lt;/span&gt; &lt;/p&gt;&lt;/span&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/8904207934075183794/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/jar-war-and-ear-files.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/8904207934075183794" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/8904207934075183794" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/jar-war-and-ear-files.html" rel="alternate" title="JAR WAR and EAR Files" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-7131710168496680561</id><published>2010-04-12T08:42:00.001+05:30</published><updated>2010-04-12T08:44:37.621+05:30</updated><title type="text">Difference between customTags and JavaBeans</title><content type="html">&lt;span xmlns=""&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&lt;span xmlns=""&gt;JavaBeans are the data handlers of JSP and aid in encapsulating data management logic. They are used for storage  Tags on the other hand, aid computational logic related to a particular request.&lt;/span&gt;&lt;span xmlns=""&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span xmlns=""&gt;Tags are thread safe; beans are not. Beans like other separate utility classes, have to be made thread safe by the developers.&lt;/span&gt;&lt;span xmlns=""&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span xmlns=""&gt;Tags are aware of the environment (the page context) in which they execute. Beans are not.&lt;/span&gt;&lt;span xmlns=""&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span xmlns=""&gt;Tags remain in the translation unit.We can think of tags as events occuring in the execution of a JSP page. Beans are object stores that reside outside the translation unit.&lt;/span&gt;&lt;span xmlns=""&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span xmlns=""&gt;Tags can access implicit objects. Beans are cannot.&lt;/span&gt;&lt;span xmlns=""&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span xmlns=""&gt;Tags only have page scope. They are created and destroyed withen a single request and in a single page. They can access other objects in all the scopes, though. Beans, on the other hand. Are themselves objects that reside in different scopes. Therefore, tags can access and manipulte beans, while beans do not access and manipulate tags.&lt;/span&gt;&lt;span xmlns=""&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span xmlns=""&gt;The Tag Extension API designed closely with the concept of a JSP page in mind. They may not be used in other applications. Beans, on the other hand are supposed to be resuable compnents and can be used by other container.&lt;/span&gt;&lt;span xmlns=""&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span xmlns=""&gt;Tags are not persistent objects. Beans have properties, and properties have values. A set of values is called the state of the bean. This state can be persisted via serialization and resued later.&lt;br /&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;span xmlns=""&gt;&lt;/span&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/7131710168496680561/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/difference-between-customtags-and.html#comment-form" rel="replies" title="1 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/7131710168496680561" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/7131710168496680561" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/difference-between-customtags-and.html" rel="alternate" title="Difference between customTags and JavaBeans" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-3663037018633349790</id><published>2010-04-11T12:50:00.001+05:30</published><updated>2010-04-11T12:56:14.186+05:30</updated><title type="text">JSP Standard Actions</title><content type="html">JSP standard actions are commands given to the JSP engine. They direct the engine to perform certain tasks during the execution of a page.&lt;br /&gt;
e.g. The following line instructs the engine to forward request to another JSP page, welcome.jsp from current JSP page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;jsp:forward page="welcome.jsp"/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are six standard JSP actions:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;jsp:include&lt;/li&gt;
&lt;li&gt;jsp:forward&lt;/li&gt;
&lt;li&gt;jsp:useBean&lt;/li&gt;
&lt;li&gt;jsp:setProperty&lt;/li&gt;
&lt;li&gt;jsp:getProperty&lt;/li&gt;
&lt;li&gt;jsp:plugin&lt;/li&gt;
&lt;/ol&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/3663037018633349790/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/jsp-standard-actions.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/3663037018633349790" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/3663037018633349790" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/jsp-standard-actions.html" rel="alternate" title="JSP Standard Actions" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-7704612290564406349</id><published>2010-04-10T16:45:00.001+05:30</published><updated>2010-05-10T14:39:30.210+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="J2EE"/><category scheme="http://www.blogger.com/atom/ns#" term="jsp"/><category scheme="http://www.blogger.com/atom/ns#" term="servlet"/><title type="text">Difference between GET Method and POST Method</title><content type="html">&lt;b&gt;GET Method&lt;/b&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Target resource type is &lt;i&gt;Active or passive&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Type of data is &lt;i&gt;Text&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;The amount of data handled by GET Method is &lt;i&gt;not more than 255 characters&lt;/i&gt;.&lt;/li&gt;
&lt;li&gt;Data is part of the URL and is &lt;i&gt;visible&lt;/i&gt; to the user in the URL field of browser.&lt;/li&gt;
&lt;li&gt;Data can be &lt;i&gt;cached&lt;/i&gt; in the browser's URL History.&lt;/li&gt;
&lt;/ol&gt;&lt;b&gt;POST Method &lt;/b&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Target resource type is &lt;i&gt;Active&lt;/i&gt; &lt;/li&gt;
&lt;li&gt;Type of data is &lt;i&gt;Text as well as Binary&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;The amount of data handled by POST Method is &lt;i&gt;unlimited&lt;/i&gt;.&lt;/li&gt;
&lt;li&gt;Data is not a part of the URL and is sent as the request message body. It is &lt;i&gt;not visible&lt;/i&gt; to the user in the URL field of browser.&lt;/li&gt;
&lt;li&gt;Data is &lt;i&gt;not cached&lt;/i&gt; in the browser's URL History.&lt;/li&gt;
&lt;/ol&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/7704612290564406349/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/difference-between-get-method-and-post.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/7704612290564406349" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/7704612290564406349" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/difference-between-get-method-and-post.html" rel="alternate" title="Difference between GET Method and POST Method" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5074681044290083024.post-6105217520728096755</id><published>2010-04-08T14:10:00.001+05:30</published><updated>2010-05-10T18:01:16.474+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Core Java"/><category scheme="http://www.blogger.com/atom/ns#" term="OOPs Concepts"/><title type="text">Difference between abstract class and interface</title><content type="html">&lt;h3&gt;What is an Abstract Class?&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;An &lt;b&gt;abstract class&lt;/b&gt; is a special kind of class that cannot be instantiated.So the question is why we need a class that cannot be instantiated? An abstract class is only to be sub-classed (inherited from). In other words, it only allows other classes to inherit from it but cannot be instantiated. The advantage is that it enforces certain hierarchies for all the subclasses. In simple words, it is a kind of contract that forces all the subclasses to carry on the same hierarchies or standards.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;A class may inherit only one abstract class.&lt;/li&gt;
&lt;li&gt;An abstract class can contain access modifiers for the subs, functions, properties&lt;/li&gt;
&lt;li&gt;Fast&lt;/li&gt;
&lt;li&gt;An abstract class can have fields and constants defined &lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;What is an Interface?&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;An interface is not a class. It is an entity that is defined by the word Interface. An interface has no implementation; it only has the signature or in other words, just the definition of the methods without the body. As one of the similarities to Abstract class, it is a contract that is used to define hierarchies for all subclasses or it defines specific set of methods and their arguments. The main difference between them is that a class can implement more than one interface but can only inherit from one abstract class.&lt;/li&gt;
&lt;li&gt;A class may &lt;b&gt;inherit several interfaces.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;An interface cannot have access modifiers for the subs, functions, properties etc everything is assumed as public&lt;/li&gt;
&lt;li&gt;Requires more time to find the actual method in the corresponding classes.&lt;/li&gt;
&lt;li&gt;  No fields can be defined in interfaces&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;
&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;</content><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/feeds/6105217520728096755/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/difference-between-abstract-class-and.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/6105217520728096755" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/5074681044290083024/posts/default/6105217520728096755" rel="self" type="application/atom+xml"/><link href="http://sharad-java-j2ee-interview-questions.blogspot.com/2010/04/difference-between-abstract-class-and.html" rel="alternate" title="Difference between abstract class and interface" type="text/html"/><author><name>Sharad</name><uri>http://www.blogger.com/profile/15754738523226225552</uri><email>noreply@blogger.com</email><gd:image height="32" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvFblEdwYGfbQTfpc0kRJ5NkyilsoZ7dPXF0bqRyNOsUIS6Zb3oYrprrVADDAfq20H2WWOWpNnZ3vCEFB-sixssxWkBUjkFVLMtCXcFWvvw558o_MlDP7mtQz5o5uQw/s220/OgAAAPtJNMAcfEmBoV2MVXx-PDRUbBB7bNCEqpa7X8Eep4_mS-3-30v5WcKQCpY1BEiaiGXCzM3jap8EqgIO22LXI5MAm1T1UHkdxWusoDXgisjK8cdvsrYFLhkr.jpg" width="24"/></author><thr:total>0</thr:total></entry></feed>