<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8773886707854553311</id><updated>2024-08-29T14:02:03.066-07:00</updated><title type='text'>Just In Time</title><subtitle type='html'>Java is Everywhere...!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>26</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-4793048978633627936</id><published>2012-06-08T18:45:00.002-07:00</published><updated>2012-06-08T18:45:50.585-07:00</updated><title type='text'>Java 1.7 New Features Over 1.6</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;b&gt;Automatic Resource Management&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Description: A proposal to support scoping of resource usage in a block with automatic resource cleanup. This addresses the common and messy problem of correctly closing or releasing resources in a finally block, particularly when needing to close multiple resources in the same block.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;this:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;BufferedReader br = new BufferedReader(new FileReader(path));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;try {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;return br.readLine();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;} finally {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;br.close();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;becomes:&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;try (BufferedReader br = new BufferedReader(new FileReader(path)) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp;return br.readLine();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;// Start a block using two resources, which will automatically&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;// be cleaned up when the block exits scope&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;do (BufferedInputStream bis = …; BufferedOutputStream bos = …) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;… // Perform action with bis and bos&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;You can declare more than one resource to close:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;try (&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp;InputStream in = new FileInputStream(src);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp;OutputStream out = new FileOutputStream(dest))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;// code&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Underscores in numeric literals&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;int one_million = 1_000_000;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Strings in switch&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;String s = ...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;switch(s) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;case &quot;quux&quot;:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; processQuux(s);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; // fall-through&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;case &quot;foo&quot;:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; case &quot;bar&quot;:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; processFooOrBar(s);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; break;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;case &quot;baz&quot;:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;processBaz(s);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; // fall-through&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;default:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; processDefault(s);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; break;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Binary literals&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;int binary = 0b1001_1001;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Improved Type Inference for Generic Instance Creation&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Map&amp;lt;String, List&amp;lt;String&amp;gt;&amp;gt; anagrams = new HashMap&amp;lt;String, List&amp;lt;String&amp;gt;&amp;gt;();&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;become:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Map&amp;lt;String, List&amp;lt;String&amp;gt;&amp;gt; anagrams = new HashMap&amp;lt;&amp;gt;();&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Better exception handling&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;this:&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;} catch (FirstException ex) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;logger.error(ex);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;throw ex;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;} catch (SecondException ex) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;logger.error(ex);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;throw ex;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;become:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;} catch (FirstException | SecondException ex) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;logger.error(ex);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; throw ex;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Language level XML support&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Description: Add support for multi-line XML (or possibly other languages or kinds of text) to be embedded within code.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Example:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
elt.appendChild(&lt;br /&gt;
&amp;amp;lt;muppet&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;name&amp;amp;gt;Kermit&amp;amp;lt;/name&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/muppet&amp;amp;gt;);&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Big Decimal&amp;nbsp;operator support&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Description: Add support for manipulating BigDecimal objects with arithmetic operators (just like other numeric primitives) instead of via method calls.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Enhanced null handling&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Description: Null-ignore invocation is concerned with dealing with possible null values in calling one or especially a chain of methods.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;For example, instead of&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public String getPostcode(Person person) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;if (person != null) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Address address = person.getAddress();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;if (address != null) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;return address.getPostcode();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;return null;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;you could instead call:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;public String getPostcode(Person person) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;return person?.getAddress()?.getPostcode();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;New file system API (NIO 2.0)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
File change notifications -&amp;gt; The WatchService API lets you receive notification events upon changes to the subject (directory or file).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;The steps involved in implementing the API are:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Create a WatchService. This service consists of a queue to hold WatchKeys.&lt;/li&gt;
&lt;li&gt;Register the directory/file you wish to monitor with this WatchService.&lt;/li&gt;
&lt;li&gt;While registering, specify the types of events you wish to receive (create, modify or delete events)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;You have to start an infinite loop to listen to events&amp;nbsp;&lt;/li&gt;
&lt;li&gt;When an event occurs, a WatchKey is placed into the queue&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Consume the WatchKey and invoke queries on it.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Date and Time API&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Description: This JSR will provide a new and improved date and time API for Java. The main goal is to build upon the lessons learned from the first two APIs (Date and Calendar) in Java SE, providing a more advanced and comprehensive model for date and time manipulation.&lt;br /&gt;
The new API will be targeted at all applications needing a data model for dates and times. This model will go beyond classes to replace Date and Calendar, to include representations of date without time, time without date, durations and intervals. This will raise the quality of application code. For example, instead of using an int to store a duration, and javadoc to describe it as being a number of days, the date and time model will provide a class defining it unambiguously.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/4793048978633627936/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2012/06/java-17-new-features-over-16.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/4793048978633627936'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/4793048978633627936'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2012/06/java-17-new-features-over-16.html' title='Java 1.7 New Features Over 1.6'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-6294655641843739887</id><published>2011-11-23T10:02:00.000-08:00</published><updated>2011-11-23T10:05:49.601-08:00</updated><title type='text'>Read Gmail from Java</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;package com.timers;&lt;br /&gt;
&lt;br /&gt;
import java.util.Properties;&lt;br /&gt;
&lt;br /&gt;
import javax.mail.Flags;&lt;br /&gt;
import javax.mail.Folder;&lt;br /&gt;
import javax.mail.Message;&lt;br /&gt;
import javax.mail.MessagingException;&lt;br /&gt;
import javax.mail.NoSuchProviderException;&lt;br /&gt;
import javax.mail.Session;&lt;br /&gt;
import javax.mail.Store;&lt;br /&gt;
import javax.mail.search.FlagTerm;&lt;br /&gt;
/**&lt;br /&gt;
&amp;nbsp;* &lt;br /&gt;
&amp;nbsp;* @author Vinay Guntaka&lt;br /&gt;
&amp;nbsp;* mail.jar is required to execute this program (download from java2s.com)&lt;br /&gt;
&amp;nbsp;* And your Gmail Credentails.&lt;br /&gt;
&amp;nbsp;* This Program reads only unread mails of your box&lt;br /&gt;
&amp;nbsp;*&lt;br /&gt;
&amp;nbsp;*/&lt;br /&gt;
public class ReadGmail {&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; while (true) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&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; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&quot;Started.......&quot;);&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; Start();&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(&quot;...Read completed.......&quot;);&lt;br /&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; try {&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; Thread.sleep(1000 * 5);&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; } catch (InterruptedException e1) {&lt;br /&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; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (Exception e) {&lt;br /&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; try {&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; e.printStackTrace();&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; System.out.println(&quot;..Error in connection Sleeping...&quot;);&lt;br /&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; } catch (Exception e1) {&lt;br /&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; }&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;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void Start() throws Exception {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Properties props = System.getProperties();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; props.setProperty(&quot;mail.store.protocol&quot;, &quot;imaps&quot;);&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; Session session = Session.getDefaultInstance(props, null);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Store store = session.getStore(&quot;imaps&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //simply username dnt include @gmail.com&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; store.connect(&quot;imap.gmail.com&quot;, &quot;username&quot;, &quot;password&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(store);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; int cout = 0;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Folder inbox = store.getFolder(&quot;Inbox&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; inbox.open(Folder.READ_ONLY);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // / to read only unread mails&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; FlagTerm ft = new FlagTerm(new Flags(Flags.Flag.SEEN), false);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Message messages[] = inbox.search(ft);&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;&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; // To read all mails from inbox&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //Message messages[] = inbox.getMessages();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; for (Message message : messages) {&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(&quot;Reading:&quot; + (messages.length - cout));&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(&quot;MEssage Content :: --&quot;&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; + message.getSubject() + message.getReceivedDate());&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; cout++;&lt;br /&gt;
&amp;nbsp;&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; } catch (NoSuchProviderException 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;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (MessagingException 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;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/6294655641843739887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2011/11/read-gmail-from-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/6294655641843739887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/6294655641843739887'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2011/11/read-gmail-from-java.html' title='Read Gmail from Java'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-6815291879020814105</id><published>2011-10-30T11:44:00.000-07:00</published><updated>2011-10-30T11:51:43.699-07:00</updated><title type='text'>Hibernate</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;1.What is ORM ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;ORM stands for object/relational mapping. ORM is the automated persistence of objects in a Java application to the tables in a relational database.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;2.What does ORM consists of ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;An ORM solution consists of the followig four pieces: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;API  for performing basic CRUD operations &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;API  to express queries refering to classes &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Facilities  to specify metadata &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Optimization  facilities : dirty checking,lazy associations fetching&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;table bgcolor=&quot;#fafafa&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 336px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;334&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;334&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;3.What are the ORM levels ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The ORM levels are: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Pure  relational (stored procedure.) &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Light  objects mapping (JDBC) &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Medium  object mapping &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Full  object Mapping (composition,inheritance, polymorphism, persistence  by reachability)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;4.What is Hibernate?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Hibernate is a pure Java object-relational mapping (ORM) and persistence framework that allows you to map plain old Java objects to relational database tables using (XML) configuration files.Its purpose is to relieve the developer from a significant amount of relational data persistence-related programming tasks.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;5.Why do you need ORM tools like hibernate?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The main advantage of ORM like hibernate is that it shields developers from messy SQL. Apart from this, ORM provides following benefits: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Improved  productivity&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;High-level   object-oriented API &lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Less   Java code to write &lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;No   SQL to write &lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Improved  performance&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Sophisticated   caching &lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Lazy   loading &lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Eager   loading &lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Improved  maintainability&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A   lot less code to write &lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Improved  portability&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;ORM   framework generates database-specific SQL for you &lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;6.What Does Hibernate Simplify?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Hibernate simplifies: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Saving  and retrieving your domain objects &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Making  database column and table name changes &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Centralizing  pre save and post retrieve logic &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Complex  joins for retrieving related items &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Schema  creation from object model &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;7.What is the need for Hibernate xml mapping file? &lt;/b&gt;&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Hibernate mapping file tells Hibernate which tables and columns to use to load and store objects. Typical mapping file look as follows:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyKvNp61s0AaHoh0KntB-LfkvTcA-qoGukhwAaju_ck_fq32IUvT8JBdthKCGwTDo8kDSoHdS_8x9j7i2XmUAnfyEZ3XK6n_yMPCbI4umGEnt3POR_0tGDd7661jOtlh2FYzZr-f_cdQ/s1600/hiber.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;180&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyKvNp61s0AaHoh0KntB-LfkvTcA-qoGukhwAaju_ck_fq32IUvT8JBdthKCGwTDo8kDSoHdS_8x9j7i2XmUAnfyEZ3XK6n_yMPCbI4umGEnt3POR_0tGDd7661jOtlh2FYzZr-f_cdQ/s320/hiber.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;8.What are the most common methods of Hibernate configuration?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The most common methods of Hibernate configuration are:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Programmatic  configuration &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;XML  configuration (&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;hibernate.cfg.xml&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;)  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;9.What are the important tags of hibernate.cfg.xml?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Following are the important tags of hibernate.cfg.xml:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSh6ZXw0DTnyXom7BGP8WdkucZXRN9cKyajzvRGPZmSOxY4LBstZ_Krqi6TVOp7s3GNcyF3kHj1cVGAwhYWRCXTXtfchWCwNAS9tLPkJ_AEcfWkKJeP2V0wNfOHRXfdzmmleLNP-j8bw/s1600/hiber1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;193&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSh6ZXw0DTnyXom7BGP8WdkucZXRN9cKyajzvRGPZmSOxY4LBstZ_Krqi6TVOp7s3GNcyF3kHj1cVGAwhYWRCXTXtfchWCwNAS9tLPkJ_AEcfWkKJeP2V0wNfOHRXfdzmmleLNP-j8bw/s320/hiber1.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;10.What are the Core interfaces are of Hibernate framework?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;1&quot; cellspacing=&quot;0&quot; style=&quot;width: 354px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;352&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td width=&quot;352&quot;&gt;&lt;div style=&quot;margin-bottom: 0in; margin-right: 0.18in; margin-top: 0.15in;&quot;&gt;&lt;span style=&quot;color: #003399; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,serif;&quot;&gt;People    who read this, also read:-&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color rgb(191, 191, 191); border-style: none none solid; border-width: medium medium 1px; margin-bottom: 0.06in; margin-top: 0.06in; padding: 0in 0in 0.08in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;     &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;EJB     Interview Questions&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;     &lt;/span&gt;&lt;/span&gt;     &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color rgb(191, 191, 191); border-style: none none solid; border-width: medium medium 1px; margin-bottom: 0.06in; margin-top: 0.06in; padding: 0in 0in 0.08in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;     &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Spring     Questions&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;     &lt;/span&gt;&lt;/span&gt;     &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color rgb(191, 191, 191); border-style: none none solid; border-width: medium medium 1px; margin-bottom: 0.06in; margin-top: 0.06in; padding: 0in 0in 0.08in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;     &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Spring     Tutorial&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;     &lt;/span&gt;&lt;/span&gt;     &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color rgb(191, 191, 191); border-style: none none solid; border-width: medium medium 1px; margin-bottom: 0.06in; margin-top: 0.06in; padding: 0in 0in 0.08in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;     &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;AJAX     Form Validation Using DWR and Spring&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;     &lt;/span&gt;&lt;/span&gt;     &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;margin-top: 0.06in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;EJB     Interview Questions&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;     &lt;/span&gt;&lt;/span&gt;     &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The five core interfaces are used in just about every Hibernate application. Using these interfaces, you can store and retrieve persistent objects and control transactions. &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Session  interface &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;SessionFactory  interface &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Configuration  interface &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Transaction  interface &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Query  and Criteria interfaces &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;table bgcolor=&quot;#fafafa&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 336px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;335&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;335&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;11.What role does the Session interface play in Hibernate?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The Session interface is the primary interface used by Hibernate applications. It is a single-threaded, short-lived object representing a conversation between the application and the persistent store. It allows you to create query objects to retrieve persistent objects.&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;Session session = sessionFactory.openSession();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Session interface role&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Wraps  a JDBC connection &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Factory  for Transaction &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Holds  a mandatory (first-level) cache of persistent objects, used when  navigating the object graph or looking up objects by identifier &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;12.What role does the SessionFactory interface play in Hibernate?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The application obtains Session instances from a SessionFactory. There is typically a single SessionFactory for the whole application—created during application initialization. The SessionFactory caches generate SQL statements and other mapping metadata that Hibernate uses at runtime. It also holds cached data that has been read in one unit of work and may be reused in a future unit of work&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;SessionFactory sessionFactory = configuration.buildSessionFactory();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;table bgcolor=&quot;#fafafa&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 336px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;335&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;335&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;13.What is the general flow of Hibernate communication with RDBMS?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The general flow of Hibernate communication with RDBMS is :&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Load  the Hibernate configuration file and create configuration object. It  will automatically load all hbm mapping files &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Create  session factory from configuration object &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Get  one session from this session factory &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Create  HQL Query &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Execute  query to get list containing Java objects &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;14.What is Hibernate Query Language (HQL)?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Hibernate offers a query language that embodies a very powerful and flexible mechanism to query, store, update, and retrieve objects from a database. This language, the Hibernate query Language (HQL), is an object-oriented extension to SQL.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;15.How do you map Java Objects with Database tables?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;First  we need to write Java domain objects (beans with setter and getter).  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Write  hbm.xml, where we map java class to table and database columns to  Java class variables. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; : &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 150%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;lt;hibernate-mapping&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;br /&gt;
&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;lt;class&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;com.test.User&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;table&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;user&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;lt;property&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;column&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;USER_NAME&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;length&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;255&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;userName&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;not-null&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;type&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;java.lang.String&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;lt;property&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;column&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;USER_PASSWORD&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;length&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;255&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;userPassword&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;not-null&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;type&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;java.lang.String&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;lt;/class&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;lt;/hibernate-mapping&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;16.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What’s the difference between load() and get()? &lt;/b&gt;&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;load() vs. get() :-&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;6&quot; cellspacing=&quot;0&quot; style=&quot;width: 613px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;316&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;271&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;316&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;load()&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;271&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;get()&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;316&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Only    use the &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;load()&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;    method if you are sure that the object exists.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;271&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;If    you are not sure that the object exists, then use one of the &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;get()&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;    methods.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;316&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;load()&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;    method will throw an exception if the unique id is not found in    the database.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;271&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;get()&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;    method will return null if the unique id is not found in the    database.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;316&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;load()&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;    just returns a proxy by default and database won’t be hit until    the proxy is first invoked. &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;271&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;get()&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;    will hit the database immediately.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;17.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is the difference between and merge and update ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Use &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;update()&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; if you are sure that the session does not contain an already persistent instance with the same identifier, and &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;merge()&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; if you want to merge your modifications at any time without consideration of the state of the session.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;18.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;How do you define sequence generated primary key in hibernate?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Using &amp;lt;generator&amp;gt; tag.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;:-&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 150%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;lt;id&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;column&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;USER_ID&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;type&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;java.lang.Long&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;lt;generator&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;class&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;sequence&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;lt;param&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;table&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;gt;SEQUENCE_NAME&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &amp;lt;generator&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;lt;/id&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;table bgcolor=&quot;#fafafa&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 336px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;335&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;335&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;19.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Define cascade and inverse option in one-many mapping?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;cascade - enable operations to cascade to child entities.&lt;br /&gt;
cascade=&quot;all|none|save-update|delete|all-delete-orphan&quot;&lt;br /&gt;
&lt;br /&gt;
inverse - mark this collection as the &quot;inverse&quot; end of a bidirectional association.&lt;br /&gt;
inverse=&quot;true|false&quot; &lt;br /&gt;
Essentially &quot;inverse&quot; indicates which end of a relationship should be ignored, so when persisting a parent who has a collection of children, should you ask the parent for its list of children, or ask the children who the parents are?&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;20.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What do you mean by Named – SQL query?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Named SQL queries are defined in the mapping xml document and called wherever required.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 150%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;lt;sql-query &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; =&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &quot;empdetails&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;lt;return&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;alias&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;emp&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;class&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;com.test.Employee&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: magenta; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT emp.EMP_ID AS {emp.empid},&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; emp.EMP_ADDRESS AS {emp.address},&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; emp.EMP_NAME AS {emp.name} &lt;br /&gt;
FROM Employee EMP WHERE emp.NAME LIKE :name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;lt;/sql-query&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Invoke Named Query :&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 150%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;List &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;people = &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;session&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;.getNamedQuery(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;empdetails&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;)&lt;br /&gt;
.setString(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;TomBrady&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;, name)&lt;br /&gt;
.setMaxResults(50)&lt;br /&gt;
.list();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.17in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;21.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;How do you invoke Stored Procedures?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 150%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;lt;sql-query&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;selectAllEmployees_SP&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;callable&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &amp;lt;return&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;alias&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;emp&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;class&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;employee&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;br /&gt;
&amp;nbsp;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;lt;return-property&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;empid&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;column&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;EMP_ID&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 150%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;lt;return-property&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;column&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;EMP_NAME&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;/&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;nbsp;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &amp;lt;return-property&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;address&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;column&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;EMP_ADDRESS&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;? = call selectAllEmployees()&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; }&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &amp;lt;/return&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;lt;/sql-query&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;22.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Explain Criteria API&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Criteria is a simplified API for retrieving entities by composing Criterion objects. This is a very convenient approach for functionality like &quot;search&quot; screens where there is a variable number of conditions to be placed upon the result set.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; :&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 150%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;List &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;employees = &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;session&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;.createCriteria(Employee.class)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .add(Restrictions.like(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;a%&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;) )&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .add(Restrictions.like(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;address&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000a0; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;Boston&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;))&lt;br /&gt;
.addOrder(Order.asc(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;) )&lt;br /&gt;
.list();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;23.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Define HibernateTemplate?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;org.springframework.orm.hibernate.HibernateTemplate&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; is a helper class which provides different methods for querying/retrieving data from the database. It also converts checked HibernateExceptions into unchecked DataAccessExceptions.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;24.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are the benefits does HibernateTemplate provide?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The benefits of HibernateTemplate are : &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;HibernateTemplate&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;,  a Spring Template class simplifies interactions with Hibernate  Session. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Common  functions are simplified to single method calls. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Sessions  are automatically closed. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Exceptions  are automatically caught and converted to runtime exceptions. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;table bgcolor=&quot;#fafafa&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 336px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;335&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;335&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;25.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;How do you switch between relational databases without code changes?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Using Hibernate SQL Dialects , we can switch databases. Hibernate will generate appropriate hql queries based on the dialect defined.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;26.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;If you want to see the Hibernate generated SQL statements on console, what should we do?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;In Hibernate configuration file set as follows: &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;lt;property&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;show_sql&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;gt;true&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&amp;lt;/property&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;27.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are derived properties?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The properties that are not mapped to a column, but calculated at runtime by evaluation of an expression are called derived properties. The expression can be defined using the formula attribute of the element. &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;1&quot; cellspacing=&quot;0&quot; style=&quot;width: 354px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;352&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td width=&quot;352&quot;&gt;&lt;div style=&quot;margin-bottom: 0in; margin-right: 0.18in; margin-top: 0.15in;&quot;&gt;&lt;span style=&quot;color: #003399; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,serif;&quot;&gt;People    who read this, also read:-&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color rgb(191, 191, 191); border-style: none none solid; border-width: medium medium 1px; margin-bottom: 0.06in; margin-top: 0.06in; padding: 0in 0in 0.08in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;     &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://www.developersbook.com/corejava/interview-questions/corejava-interview-questions-faqs.php&quot;&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Core     Java Questions &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;     &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color rgb(191, 191, 191); border-style: none none solid; border-width: medium medium 1px; margin-bottom: 0.06in; margin-top: 0.06in; padding: 0in 0in 0.08in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;     &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://www.developersbook.com/webMethods/interview-questions/webMethods-interview-questions-faqs.php&quot;&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;webMethods     Questions&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;     &lt;/span&gt;&lt;/span&gt;     &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color rgb(191, 191, 191); border-style: none none solid; border-width: medium medium 1px; margin-bottom: 0.06in; margin-top: 0.06in; padding: 0in 0in 0.08in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;     &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://www.developersbook.com/certifications/scjp/scjp5-certification.php&quot;&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;SCJP     5.0 Certification&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;     &lt;/span&gt;&lt;/span&gt;     &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color rgb(191, 191, 191); border-style: none none solid; border-width: medium medium 1px; margin-bottom: 0.06in; margin-top: 0.06in; padding: 0in 0in 0.08in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;     &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://www.developersbook.com/articles/Shale-framework-introduction.php&quot;&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;A     first look at Shale Framework&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;     &lt;/span&gt;&lt;/span&gt;     &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;margin-top: 0.06in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://www.developersbook.com/webMethods/interview-questions/webMethods-interview-questions-faqs.php&quot;&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;webMethods     Interview Questions&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;     &lt;/span&gt;&lt;/span&gt;     &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;28.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is component mapping in Hibernate?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A  component is an object saved as a value, not as a reference &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A  component can be saved directly without needing to declare  interfaces or identifier properties &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Required  to define an empty constructor &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Shared  references not supported &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4qQ_3bFaJPNPlCP8uPJgS4Jj66V2HVj6FJpd6JMAwNWuBPjMxpFLrDW-mUpt0qU-waQaxN2H-eZf1NPTqrtj4MvGpLzqd-Wz0d7ope8ozVyNhEmE4QuEQQegPxL40hyJI9K8wuEXZog/s1600/hiber2.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;206&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4qQ_3bFaJPNPlCP8uPJgS4Jj66V2HVj6FJpd6JMAwNWuBPjMxpFLrDW-mUpt0qU-waQaxN2H-eZf1NPTqrtj4MvGpLzqd-Wz0d7ope8ozVyNhEmE4QuEQQegPxL40hyJI9K8wuEXZog/s320/hiber2.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;29.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is the difference between sorted and ordered collection in hibernate?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;sorted collection vs. order collection&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; :-&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;6&quot; cellspacing=&quot;0&quot; style=&quot;width: 613px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;294&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;294&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;294&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;sorted    collection&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;294&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;order    collection&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;294&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A    sorted collection is sorting a collection by utilizing the sorting    features provided by the Java collections framework. The sorting    occurs in the memory of JVM which running Hibernate, after the    data being read from database using java comparator.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;294&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Order    collection is sorting a collection by specifying the order-by    clause for sorting this collection when retrieval.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;294&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;If    your collection is not large, it will be more efficient way to    sort it.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;294&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;If    your collection is very large, it will be more efficient way to    sort it .&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;31.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is the advantage of Hibernate over jdbc? &lt;/b&gt;&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Hibernate Vs. JDBC :-&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;6&quot; cellspacing=&quot;0&quot; style=&quot;width: 613px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;294&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;294&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; height=&quot;9&quot; width=&quot;294&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #000033; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,serif;&quot;&gt;&lt;b&gt;JDBC&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;294&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #000033; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,serif;&quot;&gt;&lt;b&gt;Hibernate&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td height=&quot;10&quot; width=&quot;294&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;With    JDBC, developer has to write code to map an object model&#39;s data    representation to a relational data model and its corresponding    database schema. &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;294&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Hibernate    is flexible and powerful ORM solution to map Java classes to    database tables. Hibernate itself takes care of this mapping using    XML files so developer does not need to write code for this.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td height=&quot;10&quot; width=&quot;294&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;With    JDBC, the automatic mapping of Java objects with database tables    and vice versa conversion is to be taken care of by the developer    manually with lines of code. &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;294&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Hibernate    provides transparent persistence and developer does not need to    write code explicitly to map database tables tuples to application    objects during interaction with RDBMS. &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td height=&quot;10&quot; width=&quot;294&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;JDBC    supports only native Structured Query Language (SQL). Developer    has to find out the efficient way to access database, i.e. to    select effective query from a number of queries to perform same    task. &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;294&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Hibernate    provides a powerful query language Hibernate Query Language    (independent from type of database) that is expressed in a    familiar SQL like syntax and includes full support for polymorphic    queries. Hibernate also supports native SQL statements. It also    selects an effective way to perform a database manipulation task    for an application. &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td height=&quot;10&quot; width=&quot;294&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Application    using JDBC to handle persistent data (database tables) having    database specific code in large amount. The code written to map    table data to application objects and vice versa is actually to    map table fields to object properties. As table changed or    database changed then it’s essential to change object structure    as well as to change code written to map    table-to-object/object-to-table.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;294&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Hibernate    provides this mapping itself. The actual mapping between tables    and application objects is done in XML files. If there is change    in Database or in any table then the only need to change XML file    properties. &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td height=&quot;10&quot; width=&quot;294&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;With    JDBC, it is developer’s responsibility to handle JDBC result set    and convert it to Java objects through code to use this persistent    data in application. So with JDBC, mapping between Java objects    and database tables is done manually. &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;294&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Hibernate    reduces lines of code by maintaining object-table mapping itself    and returns result to application in form of Java objects. It    relieves programmer from manual handling of persistent data, hence    reducing the development time and maintenance cost. &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td height=&quot;10&quot; width=&quot;294&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;With    JDBC, caching is maintained by hand-coding. &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;294&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Hibernate,    with Transparent Persistence, cache is set to application work    space. Relational tuples are moved to this cache as a result of    query. It improves performance if client application reads same    data many times for same write. Automatic Transparent Persistence    allows the developer to concentrate more on business logic rather    than this application code. &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td height=&quot;9&quot; width=&quot;294&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;In    JDBC there is no check that always every user has updated data.    This check has to be added by the developer. &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;294&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Hibernate    enables developer to define version type field to application, due    to this defined field Hibernate updates version field of database    table every time relational tuple is updated in form of Java class    object to that table. So if two users retrieve same tuple and then    modify it and one user save this modified tuple to database,    version is automatically updated for this tuple by Hibernate. When    other user tries to save updated tuple to database then it does    not allow saving it because this user does not have updated data.    &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;table bgcolor=&quot;#fafafa&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 336px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;335&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#fafafa&quot; height=&quot;21&quot; width=&quot;335&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;32.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are the Collection types in Hibernate ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Bag  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Set  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;List  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Array  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Map  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;33.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are the ways to express joins in HQL?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;HQL provides four ways of expressing (inner and outer) joins:-&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;An  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;implicit&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  association join &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;An  ordinary join in the FROM clause &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A  fetch join in the FROM clause. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;theta-style&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  join in the WHERE clause. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;34.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Define cascade and inverse option in one-many mapping?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;cascade - enable operations to cascade to child entities.&lt;br /&gt;
cascade=&quot;all|none|save-update|delete|all-delete-orphan&quot;&lt;br /&gt;
&lt;br /&gt;
inverse - mark this collection as the &quot;inverse&quot; end of a bidirectional association.&lt;br /&gt;
inverse=&quot;true|false&quot; &lt;br /&gt;
Essentially &quot;inverse&quot; indicates which end of a relationship should be ignored, so when persisting a parent who has a collection of children, should you ask the parent for its list of children, or ask the children who the parents are?&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;35.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is Hibernate proxy? &lt;/b&gt;&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;proxy&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; attribute enables lazy initialization of persistent instances of the class. Hibernate will initially return CGLIB proxies which implement the named interface. The actual persistent object will be loaded when a method of the proxy is invoked.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;table bgcolor=&quot;#fafafa&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 336px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;335&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#fafafa&quot; height=&quot;21&quot; width=&quot;335&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;36.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;How can Hibernate be configured to access an instance variable directly and not through a setter method ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;By mapping the property with access=&quot;field&quot; in Hibernate metadata. This forces hibernate to bypass the setter method and access the instance variable directly while initializing a newly loaded object.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.17in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;37.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;How can a whole class be mapped as immutable?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Mark the class as mutable=&quot;false&quot; (Default is true),. This specifies that instances of the class are (not) mutable. Immutable classes, may not be updated or deleted by the application.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;38.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is the use of dynamic-insert and dynamic-update attributes in a class mapping?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Criteria is a simplified API for retrieving entities by composing Criterion objects. This is a very convenient approach for functionality like &quot;search&quot; screens where there is a variable number of conditions to be placed upon the result set.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;dynamic-update&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  (defaults to &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;):  Specifies that &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;UPDATE&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  SQL should be generated at runtime and contain only those columns  whose values have changed &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;dynamic-insert&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  (defaults to &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;):  Specifies that &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;INSERT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  SQL should be generated at runtime and contain only the columns  whose values are not null. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;39.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What do you mean by fetching strategy ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;fetching strategy&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; is the strategy Hibernate will use for retrieving associated objects if the application needs to navigate the association. Fetch strategies may be declared in the O/R mapping metadata, or over-ridden by a particular HQL or &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;Criteria&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; query. &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;table bgcolor=&quot;#fafafa&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 336px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;335&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#fafafa&quot; height=&quot;21&quot; width=&quot;335&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;40.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is automatic dirty checking?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Automatic dirty checking is a feature that saves us the effort of explicitly asking Hibernate to update the database when we modify the state of an object inside a transaction. &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;41.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is transactional write-behind?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Hibernate uses a sophisticated algorithm to determine an efficient ordering that avoids database foreign key constraint violations but is still sufficiently predictable to the user. This feature is called transactional write-behind.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;1&quot; cellspacing=&quot;0&quot; style=&quot;width: 354px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;352&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td height=&quot;20&quot; width=&quot;352&quot;&gt;&lt;div style=&quot;margin-bottom: 0in; margin-right: 0.18in; margin-top: 0.15in;&quot;&gt;&lt;span style=&quot;color: #003399; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,serif;&quot;&gt;People    who read this, also read:-&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color rgb(191, 191, 191); border-style: none none solid; border-width: medium medium 1px; margin-bottom: 0.06in; margin-top: 0.06in; padding: 0in 0in 0.08in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;     &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://www.developersbook.com/jdbc/interview-questions/jdbc-interview-questions-faqs.php&quot;&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;JDBC     Interview Questions&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;     &lt;/span&gt;&lt;/span&gt;     &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color rgb(191, 191, 191); border-style: none none solid; border-width: medium medium 1px; margin-bottom: 0.06in; margin-top: 0.06in; padding: 0in 0in 0.08in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;     &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://www.developersbook.com/hibernate/interview-questions/hibernate-interview-questions-faqs.php&quot;&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Hibernate     Questions&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;     &lt;/span&gt;&lt;/span&gt;     &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color rgb(191, 191, 191); border-style: none none solid; border-width: medium medium 1px; margin-bottom: 0.06in; margin-top: 0.06in; padding: 0in 0in 0.08in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;     &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://www.developersbook.com/ibatis/iBatis-tutorials/iBatis-tutorials.php&quot;&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;iBatis     Tutorial&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;     &lt;/span&gt;&lt;/span&gt;     &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color rgb(191, 191, 191); border-style: none none solid; border-width: medium medium 1px; margin-bottom: 0.06in; margin-top: 0.06in; padding: 0in 0in 0.08in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;     &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://www.developersbook.com/articles/hibernate/Hiberanate-iBatis.php&quot;&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Hibernate     Vs iBatis &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;     &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;margin-top: 0.06in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://www.developersbook.com/tibco/interview-questions/tibco-interview-questions-faqs.php&quot;&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Tibco     Interview Questions&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;     &lt;/span&gt;&lt;/span&gt;     &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;42.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are Callback interfaces?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Callback interfaces allow the application to receive a notification when something interesting happens to an object—for example, when an object is loaded, saved, or deleted. Hibernate applications don&#39;t need to implement these callbacks, but they&#39;re useful for implementing certain kinds of generic functionality.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;43.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are the types of Hibernate instance states ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Three types of instance states: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Transient  -The instance is not associated with any persistence context &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Persistent  -The instance is associated with a persistence context &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Detached  -The instance was associated with a persistence context which has  been closed – currently not associated &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;44.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are the differences between EJB 3.0 &amp;amp; Hibernate&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Hibernate Vs EJB 3.0 :-&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;6&quot; cellspacing=&quot;0&quot; style=&quot;width: 613px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;299&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;288&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; height=&quot;9&quot; width=&quot;299&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #000033; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,serif;&quot;&gt;&lt;b&gt;Hibernate&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;288&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #000033; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,serif;&quot;&gt;&lt;b&gt;EJB    3.0&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td height=&quot;10&quot; width=&quot;299&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Session&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;–Cache    or collection of loaded objects relating to a single unit of work&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;288&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Persistence    Context&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;-Set    of entities that can be managed by a given EntityManager is    defined by a persistence unit&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td height=&quot;10&quot; width=&quot;299&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;XDoclet    Annotations&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;    used to support Attribute Oriented Programming&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;288&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Java    5.0 Annotations&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;    used to support Attribute Oriented Programming&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td height=&quot;10&quot; width=&quot;299&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Defines    HQL&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;    for expressing queries to the database&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;288&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Defines    EJB QL&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;    for expressing queries&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td height=&quot;10&quot; width=&quot;299&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Supports    Entity Relationships&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;    through mapping files and annotations in JavaDoc&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;288&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Support    Entity Relationships&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;    through Java 5.0 annotations&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td height=&quot;10&quot; width=&quot;299&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Provides    a Persistence Manager API&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;    exposed via the Session, Query, Criteria, and Transaction API&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;288&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Provides    and Entity Manager Interface&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;    for managing CRUD operations for an Entity&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td height=&quot;10&quot; width=&quot;299&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Provides    callback support&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;    through lifecycle, interceptor, and validatable interfaces&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;288&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Provides    callback support&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;    through Entity Listener and Callback methods&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td height=&quot;9&quot; width=&quot;299&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Entity    Relationships are unidirectional&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;.    Bidirectional relationships are implemented by two unidirectional    relationships&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;288&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Entity    Relationships are bidirectional or unidirectional&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;45.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are the types of inheritance models in Hibernate?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;There are three types of inheritance models in Hibernate:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Table  per class hierarchy &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Table  per subclass &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Table  per concrete class &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color rgb(0, 0, 10); border-style: none none double; border-width: medium medium 1.1pt; line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in; padding: 0in 0in 0.01in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 255); line-height: 0.25in; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;b&gt;Q. How will you configure Hibernate? &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;b&gt;Answer: &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
The configuration files hibernate.cfg.xml (or hibernate.properties) and mapping files *.hbm.xml are used by the Configuration class to create (i.e. configure and bootstrap hibernate) the SessionFactory, which in turn creates the Session instances. Session instances are the primary interface for the persistence service. &lt;br /&gt;
&lt;br /&gt;
&quot; hibernate.cfg.xml (alternatively can use hibernate.properties): These two files are used to configure the hibernate sevice (connection driver class, connection URL, connection username, connection password, dialect etc). If both files are present in the classpath then hibernate.cfg.xml file overrides the settings found in the hibernate.properties file. &lt;br /&gt;
&lt;br /&gt;
&quot; Mapping files (*.hbm.xml): These files are used to map persistent objects to a relational database. It is the best practice to store each object in an individual mapping file (i.e mapping file per class) because storing large number of persistent classes into one mapping file can be difficult to manage and maintain. The naming convention is to use the same name as the persistent (POJO) class name. For example Account.class will have a mapping file named Account.hbm.xml. Alternatively hibernate annotations can be used as part of your persistent class code instead of the *.hbm.xml files. &lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;b&gt;Q. What is a SessionFactory? Is it a thread-safe object? &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;b&gt;Answer: &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
SessionFactory is Hibernates concept of a single datastore and is threadsafe so that many threads can access it concurrently and request for sessions and immutable cache of compiled mappings for a single database. A SessionFactory is usually only built once at startup. SessionFactory should be wrapped in some kind of singleton so that it can be easily accessed in an application code. &lt;br /&gt;
&lt;br /&gt;
SessionFactory sessionFactory = new Configuration().configure().buildSessionfactory(); &lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;b&gt;Q. What is a Session? Can you share a session object between different theads? &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;b&gt;Answer: &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Session is a light weight and a non-threadsafe object (No, you cannot share it between threads) that represents a single unit-of-work with the database. Sessions are opened by a SessionFactory and then are closed when all work is complete. Session is the primary interface for the persistence service. A session obtains a database connection lazily (i.e. only when required). To avoid creating too many sessions ThreadLocal class can be used as shown below to get the current session no matter how many times you make call to the currentSession() method. &lt;br /&gt;
&lt;br /&gt;
&amp;amp; &lt;br /&gt;
public class HibernateUtil { &lt;br /&gt;
&amp;amp; &lt;br /&gt;
public static final ThreadLocal local = new ThreadLocal(); &lt;br /&gt;
&lt;br /&gt;
public static Session currentSession() throws HibernateException { &lt;br /&gt;
Session session = (Session) local.get(); &lt;br /&gt;
//open a new session if this thread has no session &lt;br /&gt;
if(session == null) { &lt;br /&gt;
session = sessionFactory.openSession(); &lt;br /&gt;
local.set(session); &lt;br /&gt;
} &lt;br /&gt;
return session; &lt;br /&gt;
} &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
It is also vital that you close your session after your unit of work completes. Note: Keep your Hibernate Session API handy. &lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;b&gt;Q. What are the benefits of detached objects? &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;b&gt;Answer: &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Detached objects can be passed across layers all the way up to the presentation layer without having to use any DTOs (Data Transfer Objects). You can later on re-attach the detached objects to another session. &lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;b&gt;Q. What are the pros and cons of detached objects? &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;b&gt;Answer: &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;b&gt;Pros: &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&quot; When long transactions are required due to user think-time, it is the best practice to break the long transaction up into two or more transactions. You can use detached objects from the first transaction to carry data all the way up to the presentation layer. These detached objects get modified outside a transaction and later on re-attached to a new transaction via another session. &lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;b&gt;Cons &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&quot; In general, working with detached objects is quite cumbersome, and better to not clutter up the session with them if possible. It is better to discard them and re-fetch them on subsequent requests. This approach is not only more portable but also more efficient because - the objects hang around in Hibernate&#39;s cache anyway. &lt;br /&gt;
&lt;br /&gt;
&quot; Also from pure rich domain driven design perspective it is recommended to use DTOs (DataTransferObjects) and DOs (DomainObjects) to maintain the separation between Service and UI tiers. &lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;b&gt;Q. How does Hibernate distinguish between transient (i.e. newly instantiated) and detached objects? &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;b&gt;Answer &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&quot; Hibernate uses the version property, if there is one. &lt;br /&gt;
&quot; If not uses the identifier value. No identifier value means a new object. This does work only for Hibernate managed surrogate keys. Does not work for natural keys and assigned (i.e. not managed by Hibernate) surrogate keys. &lt;br /&gt;
&quot; Write your own strategy with Interceptor.isUnsaved(). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;b&gt;Q. What is the difference between the session.get() method and the session.load() method? &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Both the session.get(..) and session.load() methods create a persistent object by loading the required object from the database. But if there was not such object in the database then the method session.load(..) throws an exception whereas session.get(&amp;amp;) returns null. &lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;b&gt;Q. What is the difference between the session.update() method and the session.lock() method? &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Both of these methods and saveOrUpdate() method are intended for reattaching a detached object. The session.lock() method simply reattaches the object to the session without checking or updating the database on the assumption that the database in sync with the detached object. It is the best practice to use either session.update(..) or session.saveOrUpdate(). Use session.lock() only if you are absolutely sure that the detached object is in sync with your detached object or if it does not matter because you will be overwriting all the columns that would have changed later on within the same transaction. &lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;b&gt;Note: &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;When you reattach detached objects you need to make sure that the dependent objects are reatched as well. &lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;b&gt;Q. How would you reatach detached objects to a session when the same object has already been loaded into the session? &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
You can use the session.merge() method call. &lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;b&gt;Q. What are the general considerations or best practices for defining your Hibernate persistent classes? &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,serif;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.You must have a default no-argument constructor for your persistent classes and there should be getXXX() (i.e accessor/getter) and setXXX( i.e. mutator/setter) methods for all your persistable instance variables. &lt;br /&gt;
&lt;br /&gt;
2.You should implement the equals() and hashCode() methods based on your business key and it is important not to use the id field in your equals() and hashCode() definition if the id field is a surrogate key (i.e. Hibernate managed identifier). This is because the Hibernate only generates and sets the field when saving the object. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. It is recommended to implement the Serializable interface. This is potentially useful if you want to migrate around a multi-processor cluster. &lt;br /&gt;
&lt;br /&gt;
4.The persistent class should not be final because if it is final then lazy loading cannot be used by creating proxy objects. &lt;br /&gt;
&lt;br /&gt;
5.Use XDoclet tags for generating your *.hbm.xml files or Annotations (JDK 1.5 onwards), which are less verbose than *.hbm.xml files. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/6815291879020814105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2011/10/hibernate.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/6815291879020814105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/6815291879020814105'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2011/10/hibernate.html' title='Hibernate'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyKvNp61s0AaHoh0KntB-LfkvTcA-qoGukhwAaju_ck_fq32IUvT8JBdthKCGwTDo8kDSoHdS_8x9j7i2XmUAnfyEZ3XK6n_yMPCbI4umGEnt3POR_0tGDd7661jOtlh2FYzZr-f_cdQ/s72-c/hiber.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-531863075631889642</id><published>2011-10-30T11:36:00.000-07:00</published><updated>2011-10-30T11:38:24.149-07:00</updated><title type='text'>Core Java</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;1.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are the principle concepts of OOPS?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;There are four principle concepts upon which object oriented design and programming rest. They are: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Abstraction  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Polymorphism  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Inheritance  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Encapsulation  (i.e. easily remembered as A-PIE). &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;2.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is Abstraction?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Abstraction refers to the act of representing essential features without including the background details or explanations.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;3.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is Encapsulation?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Encapsulation is a technique used for hiding the properties and behaviors of an object and allowing outside access only as appropriate. It prevents other objects from directly altering or accessing the properties or methods of the encapsulated object.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;4.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is the difference between abstraction and encapsulation?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Abstraction&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  focuses on the outside view of an object (i.e. the interface)  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Encapsulation&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  (information hiding) prevents clients from seeing it’s inside  view, where the behavior of the abstraction is implemented. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Abstraction&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  solves the problem in the design side while &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Encapsulation&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  is the Implementation. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Encapsulation&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  is the deliverables of Abstraction. Encapsulation barely talks about  grouping up your abstraction to suit the developer needs. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;5.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is Inheritance?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Inheritance  is the process by which objects of one class acquire the properties  of objects of another class. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A  class that is inherited is called a superclass. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The  class that does the inheriting is called a subclass. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Inheritance  is done by using the keyword extends. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The  two most common reasons to use inheritance are: &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;To   promote code reuse &lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;To   use polymorphism &lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;6.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is Polymorphism?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Polymorphism is briefly described as &quot;one interface, many implementations.&quot; Polymorphism is a characteristic of being able to assign a different meaning or usage to something in different contexts - specifically, to allow an entity such as a variable, a function, or an object to have more than one form.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;7.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;How does Java implement polymorphism?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;(Inheritance, Overloading and Overriding are used to achieve Polymorphism in java).&lt;br /&gt;
Polymorphism manifests itself in Java in the form of multiple methods having the same name. &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;In  some cases, multiple methods have the same name, but different  formal argument lists (overloaded methods). &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;In  other cases, multiple methods have the same name, same return type,  and same formal argument list (overridden methods). &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;8.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Explain the different forms of Polymorphism.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;There are two types of polymorphism one is &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Compile time polymorphism&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; and the other is run time polymorphism. Compile time polymorphism is method overloading. &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Runtime time polymorphism&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; is done using inheritance and interface.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;u&gt;&lt;b&gt;Note&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;: &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;From a practical programming viewpoint, polymorphism manifests itself in three distinct forms in Java: &lt;/i&gt;&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;Method  overloading &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;Method  overriding through inheritance &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;Method  overriding through the Java interface &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;9.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is runtime polymorphism or dynamic method dispatch?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;In Java, runtime polymorphism or dynamic method dispatch is a process in which a call to an overridden method is resolved at runtime rather than at compile-time. In this process, an overridden method is called through the reference variable of a superclass. The determination of the method to be called is based on the object being referred to by the reference variable. &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;10.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is Dynamic Binding?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Binding refers to the linking of a procedure call to the code to be executed in response to the call. Dynamic binding (also known as late binding) means that the code associated with a given procedure call is not known until the time of the call at run-time. It is associated with polymorphism and inheritance.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;11.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is method overloading?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Method Overloading means to have two or more methods with same name in the same class with different arguments. The benefit of method overloading is that it allows you to implement methods that support the same semantic operation but differ by argument number or type.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;u&gt;&lt;b&gt;Note&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;Overloaded  methods MUST change the argument list &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;Overloaded  methods CAN change the return type &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;Overloaded  methods CAN change the access modifier &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;Overloaded  methods CAN declare new or broader checked exceptions &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;A  method can be overloaded in the same class or in a subclass &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;12.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is method overriding?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Method overriding occurs when sub class declares a method that has the same type arguments as a method declared by one of its superclass. The key benefit of overriding is the ability to define behavior that’s specific to a particular subclass type.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;u&gt;&lt;b&gt;Note&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;The  overriding method cannot have a more restrictive access modifier  than the method being overridden (Ex: You can’t override a method  marked public and make it protected). &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;You  cannot override a method marked final &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;You  cannot override a method marked static &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;13.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are the differences between method overloading and method overriding?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot; style=&quot;width: 613px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;99&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;241&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;240&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;99&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;241&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Overloaded    Method&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;240&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Overridden    Method&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;99&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Arguments&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td valign=&quot;TOP&quot; width=&quot;241&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Must    change&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td valign=&quot;TOP&quot; width=&quot;240&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Must    not change&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr valign=&quot;TOP&quot;&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;99&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Return    type&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;241&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Can    change&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;240&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Can’t    change except for covariant returns&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr valign=&quot;TOP&quot;&gt;   &lt;td width=&quot;99&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Exceptions&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;241&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Can    change&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;240&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Can    reduce or eliminate. Must not throw new or broader checked    exceptions&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr valign=&quot;TOP&quot;&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;99&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Access&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;241&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Can    change&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;240&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Must    not make more restrictive (can be less restrictive)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr valign=&quot;TOP&quot;&gt;   &lt;td width=&quot;99&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Invocation&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;241&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Reference    type determines which overloaded version is selected. Happens at    compile time.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;240&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Object    type determines which method is selected. Happens at runtime.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;14.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Can overloaded methods be override too?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Yes, derived classes still can override the overloaded methods. Polymorphism can still happen. Compiler will not binding the method calls since it is overloaded, because it might be overridden now or in the future.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;15.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Is it possible to override the main method?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;NO, because main is a static method. A static method can&#39;t be overridden in Java.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;16.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;How to invoke a superclass version of an Overridden method? &lt;/b&gt;&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;To invoke a superclass method that has been overridden in a subclass, you must either call the method directly through a superclass instance, or use the super prefix in the subclass itself. From the point of the view of the subclass, the super prefix provides an explicit reference to the superclass&#39; implementation of the method. &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 100%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;  // From subclass&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 100%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;  super.overriddenMethod();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;17.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is super?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;super&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; is a keyword which is used to access the method or member variables from the superclass. If a method hides one of the member variables in its superclass, the method can refer to the hidden variable through the use of the super keyword. In the same way, if a method overrides one of the methods in its superclass, the method can invoke the overridden method through the use of the super keyword. &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;u&gt;&lt;b&gt;Note&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;: &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;You can only go back one level. In the constructor, if you use super(), it must be the very first code, and you cannot access any &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;i&gt;this.xxx&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt; variables or methods to compute its parameters. &lt;/i&gt;&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;18.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;How do you prevent a method from being overridden?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;To prevent a specific method from being overridden in a subclass, use the final modifier on the method declaration, which means &quot;this is the final implementation of this method&quot;, the end of its inheritance hierarchy. &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 100%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;b&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;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;public final void exampleMethod() {&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;//  Method statements&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;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;19.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is an Interface?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;An interface is a description of a set of methods that conforming implementing classes must have.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;u&gt;&lt;b&gt;Note&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;: &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;You can’t mark an interface as final. Interface variables must be static. An Interface cannot extend anything but another interfaces. &lt;/i&gt;&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;20.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Can we instantiate an interface?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;You can’t instantiate an interface directly, but you can instantiate a class that implements an interface.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;21.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Can we create an object for an interface?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Yes, it is always necessary to create an object implementation for an interface. Interfaces cannot be instantiated in their own right, so you must write a class that implements the interface and fulfill all the methods defined in it.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;22.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Do interfaces have member variables?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Interfaces may have member variables, but these are implicitly &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;public, static,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; and &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;final&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;- in other words, interfaces can declare only constants, not instance variables that are available to all implementations and may be used as key references for method arguments for example.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;23.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What modifiers are allowed for methods in an Interface?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Only &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; and &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;abstract&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; modifiers are allowed for methods in interfaces.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;24.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is a marker interface?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Marker interfaces are those which do not declare any required methods, but signify their compatibility with certain operations. The &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;java.io.Serializable&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; interface and &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;Cloneable&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; are typical marker interfaces. These do not contain any methods, but classes must implement this interface in order to be serialized and de-serialized.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;25.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is an abstract class?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Abstract classes are classes that contain one or more abstract methods. An abstract method is a method that is declared, but contains no implementation. &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;u&gt;&lt;b&gt;Note&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;If  even a single method is abstract, the whole class must be declared  abstract. &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;Abstract  classes may not be instantiated, and require subclasses to provide  implementations for the abstract methods. &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;You  can’t mark a class as both abstract and final. &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;26.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Can we instantiate an abstract class?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;An abstract class can never be instantiated. Its sole purpose is to be extended (subclassed).&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;27.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are the differences between Interface and Abstract class?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot; style=&quot;width: 613px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;296&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;296&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;296&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Abstract    Class &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;296&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Interfaces&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;An    abstract class can provide complete, default code and/or just the    details that have to be overridden.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;An    interface cannot provide any code at all,just the signature.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;In    case of abstract class, a class may extend only one abstract    class.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A    Class may implement several interfaces.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;An    abstract class can have non-abstract methods.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;All    methods of an Interface are abstract.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;An    abstract class can have instance variables.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;An    Interface cannot have instance variables.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;An    abstract class can have any visibility: public, private,    protected.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;An    Interface visibility must be public (or) none.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;If    we add a new method to an abstract class then we have the option    of providing default implementation and therefore all the existing    code might work properly.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;If    we add a new method to an Interface then we have to track down all    the implementations of the interface and define implementation for    the new method.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;An    abstract class can contain constructors .&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;An    Interface cannot contain constructors .&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Abstract    classes are fast.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Interfaces    are slow as it requires extra indirection to find corresponding    method in the actual class.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;28.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;When should I use abstract classes and when should I use interfaces?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Use Interfaces when…&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;You  see that something in your design will change frequently. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;If  various implementations only share method signatures then it is  better to use Interfaces.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;you  need some classes to use some methods which you don&#39;t want to be  included in the class, then you go for the interface, which makes it  easy to just implement and make use of the methods defined in the  interface. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Use Abstract Class when…&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;If  various implementations are of the same kind and use common behavior  or status then abstract class is better to use. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;When  you want to provide a generalized form of abstraction and leave the  implementation task with the inheriting subclass.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Abstract  classes are an excellent way to create planned inheritance  hierarchies. They&#39;re also a good choice for nonleaf classes in class  hierarchies. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;29.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;When you declare a method as abstract, can other nonabstract methods access it?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Yes, other nonabstract methods can access a method that you declare as abstract. &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;30.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Can there be an abstract class with no abstract methods in it?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Yes, there can be an abstract class without abstract methods.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;31.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is Constructor?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A  constructor is a special method whose task is to initialize the  object of its class. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;It  is special because its name is the &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;same  as the class name&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;.  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;They  do not have return types, not even &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;void&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  and therefore they cannot return values. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;They  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;cannot  be inherited&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;,  though a derived class can call the base class constructor. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Constructor  is invoked whenever an object of its associated class is created. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;32.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;How does the Java default constructor be provided?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;If a class defined by the code does &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;not&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; have any constructor, compiler will automatically provide one no-parameter-constructor (default-constructor) for the class in the byte code. The access modifier (public/private/etc.) of the default constructor is the same as the class itself.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;33.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Can constructor be inherited?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;No, constructor cannot be inherited, though a derived class can call the base class constructor.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;34.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are the differences between Contructors and Methods?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;1&quot; style=&quot;width: 613px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;98&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;240&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;238&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;98&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;240&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Constructors&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;238&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Methods&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr valign=&quot;TOP&quot;&gt;   &lt;td width=&quot;98&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Purpose&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;240&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Create    an instance of a class&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;238&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Group    Java statements&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr valign=&quot;TOP&quot;&gt;   &lt;td width=&quot;98&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Modifiers&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;240&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Cannot    be &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;abstract,    final, native, static&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;,    or &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;synchronized&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;238&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Can    be &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;abstract,    final, native, static&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;,    or &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;synchronized&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr valign=&quot;TOP&quot;&gt;   &lt;td width=&quot;98&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Return    Type&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;240&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;No    return type, not even void&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;238&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;void    or a valid return type&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr valign=&quot;TOP&quot;&gt;   &lt;td width=&quot;98&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;240&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Same    name as the class (first letter is capitalized by convention) --    usually a noun&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;238&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Any    name except the class. Method names begin with a lowercase letter    by convention -- usually the name of an action&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr valign=&quot;TOP&quot;&gt;   &lt;td width=&quot;98&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;&lt;b&gt;this&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;240&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Refers    to another constructor in the same class. If used, it must be the    first line of the constructor&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;238&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Refers    to an instance of the owning class. Cannot be used by static    methods.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr valign=&quot;TOP&quot;&gt;   &lt;td width=&quot;98&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;&lt;b&gt;super&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;240&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Calls    the constructor of the parent class. If used, must be the first    line of the constructor&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;238&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Calls    an overridden method in the parent class&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr valign=&quot;TOP&quot;&gt;   &lt;td width=&quot;98&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Inheritance&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;240&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Constructors    are not inherited&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;238&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Methods    are inherited&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;35.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;How are this() and super() used with constructors?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Constructors  use &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;this&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  to refer to another constructor in the same class with a different  parameter list. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Constructors  use &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;super&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  to invoke the superclass&#39;s constructor. If a constructor uses &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;super&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;,  it must use it in the first line; otherwise, the compiler will  complain. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;36.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are the differences between Class Methods and Instance Methods?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot; style=&quot;width: 613px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;296&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;296&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;296&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Class    Methods &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;296&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Instance    Methods &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Class    methods are methods which are declared as static. The method can    be called without creating an instance of the class&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Instance    methods on the other hand require an instance of the class to    exist before they can be called, so an instance of a class needs    to be created by using the new keyword.&lt;br /&gt;
Instance methods    operate on specific instances of classes.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Class    methods can only operate on class members and not on instance    members as class methods are unaware of instance members.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Instance    methods of the class can also not be called from within a class    method unless they are being called on an instance of that class. &lt;/span&gt;&lt;/span&gt;    &lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Class    methods are methods which are declared as static. The method can    be called without creating an&amp;nbsp; instance of the class.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Instance    methods are not declared as static.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;37.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;How are this() and super() used with constructors?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Constructors  use &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;this&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  to refer to another constructor in the same class with a different  parameter list. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Constructors  use &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;super&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  to invoke the superclass&#39;s constructor. If a constructor uses super,  it must use it in the first line; otherwise, the compiler will  complain. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;38.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are Access Specifiers?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;One of the techniques in object-oriented programming is &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;encapsulation&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;. It concerns the hiding of data in a class and making this class available only through methods. Java allows you to control access to classes, methods, and fields via so-called &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;access specifiers&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;..&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;39.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are Access Specifiers available in Java?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Java offers four access specifiers, listed below in decreasing accessibility: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Public&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;-  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;public&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  classes, methods, and fields can be accessed from everywhere. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Protected&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;-  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;protected&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  methods and fields can only be accessed within the same class to  which the methods and fields belong, within its subclasses, and  within classes of the same package. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Default(no  specifier)- &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;If  you do not set access to specific level, then such a class, method,  or field will be accessible from inside the same package to which  the class, method, or field belongs, but not from outside this  package. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Private&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;-  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;private&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  methods and fields can only be accessed within the same class to  which the methods and fields belong. &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;private&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  methods and fields are not visible within subclasses and are not  inherited by subclasses. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;1&quot; style=&quot;width: 613px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;175&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;65&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;185&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;59&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;71&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;175&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&amp;nbsp;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Situation&amp;nbsp;    &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;65&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&amp;nbsp;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;b&gt;public&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;    &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;185&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&amp;nbsp;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;b&gt;protected&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;    &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;59&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&amp;nbsp;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;default&amp;nbsp;    &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;71&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&amp;nbsp;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;b&gt;private&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;    &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;175&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&amp;nbsp;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Accessible    to class &lt;br /&gt;
&amp;nbsp;from same package?&amp;nbsp; &lt;/span&gt;&lt;/span&gt;    &lt;/td&gt;   &lt;td width=&quot;65&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;yes    &lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;185&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;yes    &lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;59&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;yes    &lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;71&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;no    &lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;175&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&amp;nbsp;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Accessible    to class &lt;br /&gt;
&amp;nbsp;from different package?&amp;nbsp; &lt;/span&gt;&lt;/span&gt;    &lt;/td&gt;   &lt;td width=&quot;65&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;yes    &lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;185&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&amp;nbsp;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;no,    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;unless    it is a subclass&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;59&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;no    &lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;71&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;no    &lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;40.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is final modifier?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The&amp;nbsp;final&amp;nbsp;modifier keyword makes that the programmer cannot change the value anymore. The actual meaning depends on whether it is applied to a class, a variable, or a method. &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;&lt;b&gt;final&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;  Classes&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;-  A final class cannot have subclasses. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;&lt;b&gt;final&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;  Variables&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;-  A final variable cannot be changed once it is initialized. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;&lt;b&gt;final&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;  Methods&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;-  A final method cannot be overridden by subclasses. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;41.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are the uses of final method?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;There are two reasons for marking a method as final: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Disallowing  subclasses to change the meaning of the method. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Increasing  efficiency by allowing the compiler to turn calls to the method into  inline Java code. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;42.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is static block?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Static block which exactly executed exactly once when the class is first loaded into JVM. Before going to the main method the static block will execute.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;43.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are static variables?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Variables that have only one copy per class are known as static variables. They are not attached to a particular instance of a class but rather belong to a class as a whole. They are declared by using the static keyword as a modifier.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 150%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt; &lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;  static type  varIdentifier;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;where, the name of the variable is varIdentifier and its data type is specified by type.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;u&gt;&lt;b&gt;Note&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;: Static variables that are not explicitly initialized in the code are automatically initialized with a default value. The default value depends on the data type of the variables.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;44.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is the difference between static and non-static variables?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A static variable is associated with the class as a whole rather than with specific instances of a class. Non-static variables take on unique values with each object instance.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;45.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are static methods?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Methods declared with the keyword static as modifier are called static methods or class methods. They are so called because they affect a class as a whole, not a particular instance of the class. Static methods are always invoked without reference to a particular instance of a class.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;u&gt;&lt;b&gt;Note&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;:The use of a static method suffers from the following restrictions: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;A  static method can only call other static methods.&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;A  static method must only access static data.&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;A  static method &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;&lt;b&gt;cannot&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;  reference to the current object using keywords &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;super&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;  or &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;this&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;.&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;46.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is an Iterator ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The  Iterator interface is used to step through the elements of a  Collection. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Iterators  let you process each element of a&amp;nbsp;Collection. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Iterators  are a generic way to go through all the elements of a&amp;nbsp;Collection&amp;nbsp;no  matter how it is organized. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Iterator  is an&amp;nbsp;Interface&amp;nbsp;implemented a different way for  every&amp;nbsp;Collection. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;47.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;How do you traverse through a collection using its Iterator?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;To use an iterator to traverse through the contents of a collection, follow these steps: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Obtain  an iterator to the start of the collection by calling the  collectionâ€™s &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;&lt;b&gt;iterator()&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  method. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Set  up a loop that makes a call to &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;&lt;b&gt;hasNext()&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;.  Have the loop iterate as long as &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;&lt;b&gt;hasNext()&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  returns &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;true&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;.  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Within  the loop, obtain each element by calling &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;next()&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;.  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;48.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;How do you remove elements during Iteration?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Iterator also has a method &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;&lt;b&gt;remove()&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; when remove is called, the current element in the iteration is deleted.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;49.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is the difference between Enumeration and Iterator?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;1&quot; style=&quot;width: 613px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;295&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;294&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;295&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Enumeration&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;294&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Iterator&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr valign=&quot;TOP&quot;&gt;   &lt;td width=&quot;295&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Enumeration    doesn&#39;t have a remove() method&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;294&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Iterator    has a remove() method&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr valign=&quot;TOP&quot;&gt;   &lt;td width=&quot;295&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Enumeration    acts as Read-only interface, because it has the methods only to    traverse and fetch the objects&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;294&quot;&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Can    be &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;abstract,    final, native, static&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;,    or &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;synchronized&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;u&gt;&lt;b&gt;Note&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;: So Enumeration is used whenever we want to make Collection objects as Read-only.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;50.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;How is ListIterator?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;ListIterator&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; is just like Iterator, except it allows us to access the collection in either the forward or backward direction and lets us modify an element &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;51.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is the List interface?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The  List interface provides support for ordered collections of objects. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Lists  may contain duplicate elements. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;52.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are the main implementations of the List interface ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The main implementations of the List interface are as follows : &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;ArrayList&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  : Resizable-array implementation of the List interface. The best  all-around implementation of the List interface. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Vector&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  : Synchronized resizable-array implementation of the List interface  with additional &quot;legacy methods.&quot; &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;LinkedList&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  : Doubly-linked list implementation of the List interface. May  provide better performance than the ArrayList implementation if  elements are frequently inserted or deleted within the list. Useful  for queues and double-ended queues (deques). &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;53.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are the advantages of ArrayList over arrays ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Some of the advantages ArrayList has over arrays are: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;It  can grow dynamically &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;It  provides more powerful insertion and search mechanisms than arrays. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;54.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Difference between ArrayList and Vector ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot; style=&quot;width: 613px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;296&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;296&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;296&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;ArrayList&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;296&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Vector    &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;ArrayList    is &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;NOT&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;    synchronized by default.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Vector    List is synchronized by default.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;ArrayList    can use only Iterator to access the elements.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Vector    list can use Iterator and Enumeration Interface to access the    elements.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The    ArrayList increases its array size by 50 percent if it runs out of    room.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A    Vector defaults to doubling the size of its array if it runs out    of room&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;ArrayList    has no default size.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;While    vector has a default size of 10.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;55.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;How to obtain Array from an ArrayList ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Array can be obtained from an ArrayList using &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;&lt;b&gt;toArray() &lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;method on ArrayList.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 150%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; List arrayList = new ArrayList();&lt;br /&gt;
arrayList.add(â€¦&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 150%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 150%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; ObjectÂ&amp;nbsp; a[] = &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;b&gt;arrayList.toArray()&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;56.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Why insertion and deletion in ArrayList is slow compared to LinkedList ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;ArrayList  &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;internally  uses and array to store the elements, when that array gets filled by  inserting elements a new array of roughly 1.5 times the size of the  original array is created and all the data of old array is copied to  new array. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;During  deletion, all elements present in the array after the deleted  elements have to be moved one step back to fill the space created by  deletion. In linked list data is stored in nodes that have reference  to the previous node and the next node so adding element is simple  as creating the node an updating the next pointer on the last node  and the previous pointer on the new node.&amp;nbsp;Deletion in linked  list is fast because it involves only updating&amp;nbsp;the next pointer  in the node before the deleted node and updating the previous  pointer in the node after the deleted node. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;57.Why are Iterators returned by ArrayList called Fail Fast ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Because, if list is structurally modified at any time after the iterator is created, in any way except through the iterator&#39;s own remove or add methods, the iterator will throw a ConcurrentModificationException. Thus, in the face of concurrent modification, the iterator fails quickly and cleanly, rather than risking arbitrary, non-deterministic behavior at an undetermined time in the future.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;58.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;How do you decide when to use ArrayList and When to use LinkedList?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;If you need to support random access, without inserting or removing elements from any place other than the end, then ArrayList offers the optimal collection. If, however, you need to frequently add and remove elements from the middle of the list and only access the list elements sequentially, then LinkedList offers the better implementation.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;59.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is the Set interface ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The  Set interface provides methods for accessing the elements of a  finite mathematical set &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Sets  do not allow duplicate elements &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Contains  no methods other than those inherited from Collection &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;It  adds the restriction that duplicate elements are prohibited &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Two  Set objects are equal if they contain the same elements &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;60.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are the main Implementations of the Set interface ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The main implementations of the List interface are as follows: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;HashSet  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;TreeSet  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;LinkedHashSet  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;EnumSet  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;61.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is a HashSet ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A  HashSet is an unsorted, unordered Set. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;It  uses the hashcode of the object being inserted (so the more  efficient your hashcode() implementation the better access  performance you’ll get). &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Use  this class when you want a collection with no duplicates and you  don’t care about order when you iterate through it. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;62.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is a TreeSet ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;TreeSet is a Set implementation that keeps the elements in sorted order. The elements are sorted according to the natural order of elements or by the comparator provided at creation time.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;63.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is an EnumSet ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;An EnumSet is a specialized set for use with enum types, all of the elements in the EnumSet type that is specified, explicitly or implicitly, when the set is created.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;64.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Difference between HashSet and TreeSet ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot; style=&quot;width: 613px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;296&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;296&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;296&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;HashSet&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;296&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;TreeSet&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;HashSet    is under set interface i.e. it&amp;nbsp; does not guarantee for either    sorted order or sequence order.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;TreeSet    is under set i.e. it provides elements in a sorted&amp;nbsp; order    (acceding order).&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;We    can add any type of elements to hash set.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;We    can add only similar types&lt;br /&gt;
of elements to tree set.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;65.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is a Map ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A  map is an object that stores associations between keys and values  (key/value pairs). &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Given  a key, you can find its value. Both keys&amp;nbsp; and&amp;nbsp; values are  objects. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The  keys must be unique, but the values may be duplicated. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Some  maps can accept a null key and null values, others cannot. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;66.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are the main Implementations of the Map interface ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The main implementations of the List interface are as follows: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;HashMap  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;HashTable  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;TreeMap  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;EnumMap  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;67.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is a TreeMap ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;TreeMap actually implements the SortedMap interface which extends the Map interface. In a TreeMap the data will be sorted in ascending order of keys according to the natural order for the key&#39;s class, or by the comparator provided at creation time. TreeMap is based on the Red-Black tree data structure.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;68.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;How do you decide when to use HashMap and when to use TreeMap ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;For inserting, deleting, and locating elements in a Map, the HashMap offers the best alternative. If, however, you need to traverse the keys in a sorted order, then TreeMap is your better alternative. Depending upon the size of your collection, it may be faster to add elements to a HashMap, then convert the map to a TreeMap for sorted key traversal.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;69.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Difference between HashMap and Hashtable ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot; style=&quot;width: 613px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;296&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;296&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;296&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;HashMap&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;296&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Hashtable&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;HashMap    lets you have null values as well as one null key.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;HashTable&amp;nbsp;    does not allows null values as key and value.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The    iterator in the HashMap is fail-safe (If you change the map while    iterating, you’ll know).&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The    enumerator for the Hashtable is not fail-safe.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;HashMap    is unsynchronized.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Hashtable    is synchronized.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;u&gt;&lt;b&gt;Note&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;: Only one NULL is allowed as a key in HashMap. HashMap does not allow multiple keys to be NULL. Nevertheless, it can have multiple NULL values. &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;70.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;How does a Hashtable internally maintain the key-value pairs?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;TreeMap actually implements the SortedMap interface which extends the Map interface. In a TreeMap the data will be sorted in ascending order of keys according to the natural order for the key&#39;s class, or by the comparator provided at creation time. TreeMap is based on the Red-Black tree data structure.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;71.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What Are the different Collection Views That Maps Provide?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Maps Provide Three Collection Views.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Key  Set &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;-  allow a map&#39;s contents to be viewed as a set of keys. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Values  Collection&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  - allow a map&#39;s contents to be viewed as a set of values. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Entry  Set&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  - allow a map&#39;s contents to be viewed as a set of key-value  mappings. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;72.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is a KeySet View ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;KeySet is a set returned by the &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;&lt;b&gt;keySet()&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; method of the Map Interface, It is a set that contains all the keys present in the Map.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;73.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is a Values Collection View ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Values Collection View is a collection returned by the &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;&lt;b&gt;values()&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; method of the Map Interface, It contains all the objects present as values in the map.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;74.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is an EntrySet View ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Entry Set view is a set that is returned by the &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;&lt;b&gt;entrySet()&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; method in the map and contains Objects of type Map. Entry each of which has both Key and Value.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;75.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;How do you sort an ArrayList (or any list) of user-defined objects ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Create an implementation of the &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;java.lang.Comparable&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; interface that knows how to order your objects and pass it to &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;java.util.Collections.sort&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;(List, Comparator).&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;76.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is the Comparable interface ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The Comparable interface is used to sort collections and arrays of objects using the &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;i&gt;Collections.sort()&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; and &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;i&gt;java.utils.Arrays.sort()&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; methods respectively. The objects of the class implementing the Comparable interface can be ordered.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The Comparable interface in the generic form is written as follows: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 150%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; interface Comparable&amp;lt;T&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.17in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;where T is the name of the type parameter.&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
All classes implementing the Comparable interface must implement the &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;compareTo()&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; method that has the return type as an integer. The signature of the &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;compareTo() &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;method is as follows:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 150%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;      &lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;int i = object1.compareTo(object2)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;If  object1 &amp;lt; object2: The value of i returned will be negative. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;If  object1 &amp;gt; object2: The value of i returned will be positive. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;If  object1 = object2: The value of i returned will be zero. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;77.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are the differences between the Comparable and Comparator interfaces ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot; style=&quot;width: 613px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;296&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;296&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;296&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Comparable&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;296&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Comparato&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;296&quot;&gt;&lt;div style=&quot;margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;It    uses the &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;compareTo()&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;    method. &lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;div style=&quot;margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;int    objectOne.compareTo(objectTwo).&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;t    uses the &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;compare()    &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;method.&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;int    compare(ObjOne, ObjTwo)&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;It    is necessary to modify the class whose instance is going to be    sorted.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A    separate class can be created in order to sort the instances.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Only    one sort sequence can be created.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Many    sort sequences can be created.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;It    is frequently used by the API classes.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;It    used by third-party classes to sort instances.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;&lt;u&gt;&lt;b&gt;Exceptions &lt;/b&gt;&lt;/u&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;1.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is an exception?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;An &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;exception&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; is an event, which occurs during the execution of a program, that disrupts the normal flow of the program&#39;s instructions.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;2.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is error?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;An Error indicates that a non-recoverable condition has occurred that should not be caught. Error, a subclass of Throwable, is intended for drastic problems, such as OutOfMemoryError, which would be reported by the JVM itself.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;3.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Which is superclass of Exception?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;&quot;Throwable&quot;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;, the parent class of all exception related classes. &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;4.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are the advantages of using exception handling?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Exception handling provides the following advantages over &quot;traditional&quot; error management techniques: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Separating  Error Handling Code from &quot;Regular&quot; Code. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Propagating  Errors Up the Call Stack. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Grouping  Error Types and Error Differentiation. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;5.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are the types of Exceptions in Java&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;There are two types of exceptions in Java, unchecked exceptions and checked exceptions. &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Checked  exceptions&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;:  A checked exception is some subclass of Exception (or Exception  itself), excluding class RuntimeException and its subclasses. Each  method must either handle all checked exceptions by supplying a  catch clause or list each unhandled checked exception as a thrown  exception. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Unchecked  exceptions:&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  All Exceptions that extend the RuntimeException class are unchecked  exceptions. Class Error and its subclasses also are unchecked. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;6.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Why Errors are Not Checked?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A unchecked exception classes which are the &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;error&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; classes (Error and its subclasses) are exempted from compile-time checking because they can occur at many points in the program and recovery from them is difficult or impossible. A program declaring such exceptions would be pointlessly.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;7.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Why Runtime Exceptions are Not Checked?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;runtime exception&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; classes (&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;RuntimeException&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; and its subclasses) are exempted from compile-time checking because, in the judgment of the designers of the Java programming language, having to declare such exceptions would not aid significantly in establishing the correctness of programs. Many of the operations and constructs of the Java programming language can result in runtime exceptions. The information available to a compiler, and the level of analysis the compiler performs, are usually not sufficient to establish that such run-time exceptions cannot occur, even though this may be obvious to the programmer. Requiring such exception classes to be declared would simply be an irritation to programmers.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;8.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Explain the significance of try-catch blocks?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Whenever the exception occurs in Java, we need a way to tell the JVM what code to execute. To do this, we use the try and catch keywords. The try is used to define a block of code in which exceptions may occur. One or more catch clauses match a specific exception to a block of code that handles it.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzO2gwgKZg8SrWsA4fK7XLB_Jzx20JQt6jSiBLZ6bHpoYasvGAQAGevkTa3POxlpk8aAuwl7dS-y8IlDrMeU8sVjFyyY-WVreOjqqsVbu6AJ1ZJwN4gchHnaS9njCr9jt58gs4ZduwWQ/s1600/Try.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;159&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzO2gwgKZg8SrWsA4fK7XLB_Jzx20JQt6jSiBLZ6bHpoYasvGAQAGevkTa3POxlpk8aAuwl7dS-y8IlDrMeU8sVjFyyY-WVreOjqqsVbu6AJ1ZJwN4gchHnaS9njCr9jt58gs4ZduwWQ/s320/Try.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;9.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is the use of finally block?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;1&quot; cellspacing=&quot;0&quot; style=&quot;width: 30px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;28&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td width=&quot;28&quot;&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;margin-top: 0.06in;&quot;&gt;&lt;span style=&quot;color: #666666; font-size: small;&quot;&gt; &lt;/span&gt;     &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The finally block encloses code that is always executed at some point after the try block, whether an exception was thrown or not. This is right place to close files, release your network sockets, connections, and perform any other cleanup your code requires.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;u&gt;&lt;b&gt;Note&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;:&amp;nbsp;If the try block executes with no exceptions, the finally block is executed immediately after the try block completes. It there was an exception thrown, the finally block executes immediately after the proper catch block completes&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;10.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What if there is a break or return statement in try block followed by finally block?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;If there is a return statement in the try block, the finally block executes right after the return statement encountered, and before the return executes.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;11.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Can we have the try block without catch block?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Yes, we can have the try block without catch block, but finally block should follow the try block.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;u&gt;&lt;b&gt;Note:&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&amp;nbsp;It is not valid to use a try clause without either a catch clause or a finally clause. &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;12.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is the difference throw and throws?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;u&gt;&lt;b&gt;throws:&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; Used in a method&#39;s signature if a method is capable of causing an exception that it does not handle, so that callers of the method can guard themselves against that exception. If a method is declared as throwing a particular class of exceptions, then any other method that calls it must either have a try-catch clause to handle that exception or must be declared to throw that exception (or its superclass) itself.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A method that does not handle an exception it throws has to announce this: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 150%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;  &lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;public void &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;myfunc(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;int &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;arg) &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;b&gt;throws&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;MyException {&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;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;u&gt;&lt;b&gt;throw:&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; Used to trigger an exception. The exception will be caught by the nearest try-catch clause that can catch that type of exception. The flow of execution stops immediately after the throw statement; any subsequent statements are not executed.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;To throw an user-defined exception within a block, we use the throw command: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 150%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;  &lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;b&gt;throw &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;new &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;MyException(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&quot;I always wanted to throw an exception!&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;13.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;How to create custom exceptions?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A. By extending the Exception class or one of its subclasses.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;u&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 150%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;class &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;MyException &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;extends Exception &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;{&lt;br /&gt;
&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;public &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;MyException() { &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;super&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;(); }&lt;br /&gt;
&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;public &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;MyException(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;String &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;s) { &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #800040; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;super&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;(s); }&lt;br /&gt;
&amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;14.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are the different ways to handle exceptions?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman,serif; font-size: small;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;1&quot; cellspacing=&quot;0&quot; style=&quot;width: 6px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;4&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td width=&quot;4&quot;&gt;&lt;ul&gt;&lt;li&gt;    &lt;/li&gt;
&lt;/ul&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;There are two ways to handle exceptions: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Wrapping  the desired code in a try block followed by a catch block to catch  the exceptions. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;List  the desired exceptions in the throws clause of the method and let  the caller of the method handle those exceptions. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;u&gt; &lt;i&gt;&lt;b&gt;JDBC&lt;/b&gt;&lt;/i&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;1.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What is the JDBC?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Java Database Connectivity (JDBC) is a standard Java API to interact with relational databases form Java. JDBC has set of classes and interfaces which can use from Java application and talk to database without learning RDBMS details and using Database Specific JDBC Drivers.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;2.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are the new features added to JDBC 4.0?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The major features added in JDBC 4.0 include :&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Auto-loading  of JDBC driver class &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Connection  management enhancements &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Support  for &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;RowId&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  SQL type &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;DataSet  implementation of SQL using Annotations &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;SQL  exception handling enhancements &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;SQL  XML support&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;3.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Explain Basic Steps in writing a Java program using&amp;nbsp;JDBC?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;JDBC makes the interaction with RDBMS simple and intuitive. When a Java application needs to access database : &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Load  the RDBMS specific JDBC driver because this driver actually  communicates with the database (Incase of JDBC 4.0 this is  automatically loaded). &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Open  the connection to database which is then used to send SQL statements  and get results back. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Create  JDBC Statement object. This object contains SQL query. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Execute  statement which returns resultset(s). ResultSet contains the tuples  of database table as a result of SQL query. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Process  the result set. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Close  the connection. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;4.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;Exaplain the JDBC Architecture.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The JDBC Architecture consists of two layers: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The  JDBC API, which provides the application-to-JDBC Manager connection.  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The  JDBC Driver API, which supports the JDBC Manager-to-Driver  Connection. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The JDBC API uses a driver manager and database-specific drivers to provide transparent connectivity to heterogeneous databases. The JDBC driver manager ensures that the correct driver is used to access each data source. The driver manager is capable of supporting multiple concurrent drivers connected to multiple heterogeneous databases. The location of the driver manager with respect to the JDBC drivers and the Java application is shown in Figure 1.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;CENTER&quot; style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Arial,serif; font-size: small;&quot;&gt;&lt;b&gt;Figure 1: JDBC Architecture&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxC-GOUwE3x4G6yJKzPqyjCJo6bmrLYo-MJ6A34au4_QD870Uywz5_tNoeX4zPTiG7vgYuJ7aB-uUXFGj0fcEbN0Hh5X8YBcmIEIuJ80BF2JFo-tIuNNkpxMg_-IIzTtQOQqcs5q5GoQ/s1600/JDBC.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;262&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxC-GOUwE3x4G6yJKzPqyjCJo6bmrLYo-MJ6A34au4_QD870Uywz5_tNoeX4zPTiG7vgYuJ7aB-uUXFGj0fcEbN0Hh5X8YBcmIEIuJ80BF2JFo-tIuNNkpxMg_-IIzTtQOQqcs5q5GoQ/s320/JDBC.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;CENTER&quot; style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;5.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;What are the main components of JDBC ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The life cycle of a servlet consists of the following phases:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;DriverManager:  Manages a list of database drivers. Matches connection requests from  the java application with the proper database driver using  communication subprotocol. The first driver that recognizes a  certain subprotocol under JDBC will be used to establish a database  Connection. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Driver:  The database communications link, handling all communication with  the database. Normally, once the driver is loaded, the developer  need not call it explicitly. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Connection  : Interface with all methods for contacting a database.The  connection object represents communication context, i.e., all  communication with database is through connection object only. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Statement  : Encapsulates an SQL statement which is passed to the database to  be parsed, compiled, planned and executed.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;ResultSet:  The ResultSet represents set of rows retrieved due to query  execution. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;6.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;How the JDBC application works? &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A JDBC application can be logically divided into two layers: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;1. Driver layer &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;2. Application layer &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Driver  layer consists of DriverManager class and the available JDBC  drivers. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The  application begins with requesting the DriverManager for the  connection. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;An  appropriate driver is choosen and is used for establishing the  connection. This connection is given to the application which falls  under the application layer. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The  application uses this connection to create Statement kind of  objects, through which SQL commands are sent to backend and obtain  the results. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;CENTER&quot; style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: Arial,serif; font-size: small;&quot;&gt;&lt;b&gt;Figure 2: JDBC Application&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;CENTER&quot; style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgogOlxfT1lU0ECex1VbpSO_EUz5g8Nof1Wfw18rx6jqFfVTjjVquMoa1pcKFVLh4k-IzeivTOSuJxVi7YkoILMVNpT8SV2av9Ax4OOkRNQToZH-8qtGcTjsRns-hR6xgnwXpz8QuAAJA/s1600/JDBC1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;132&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgogOlxfT1lU0ECex1VbpSO_EUz5g8Nof1Wfw18rx6jqFfVTjjVquMoa1pcKFVLh4k-IzeivTOSuJxVi7YkoILMVNpT8SV2av9Ax4OOkRNQToZH-8qtGcTjsRns-hR6xgnwXpz8QuAAJA/s320/JDBC1.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;CENTER&quot; style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;7.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;How do I load a database driver with JDBC 4.0 / Java 6?&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Provided the JAR file containing the driver is properly configured, just place the JAR file in the classpath. Java developers NO longer need to explicitly load JDBC drivers using code like &lt;span style=&quot;color: #222222;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;Class.forName()&lt;/span&gt;&lt;/span&gt; to register a JDBC driver.The DriverManager class takes care of this by automatically locating a suitable driver when the &lt;span style=&quot;color: #222222;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;DriverManager.getConnection()&lt;/span&gt;&lt;/span&gt; method is called. This feature is backward-compatible, so no changes are needed to the existing JDBC code.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;8.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;What is JDBC Driver interface?&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The JDBC Driver interface provides vendor-specific implementations of the abstract classes provided by the JDBC API. Each vendor driver must provide implementations of the &lt;span style=&quot;color: #222222;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;java.sql.Connection,Statement,PreparedStatement, CallableStatement, ResultSet&lt;/span&gt;&lt;/span&gt; and &lt;span style=&quot;color: #222222;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;Driver&lt;/span&gt;&lt;/span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;9.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;What does the connection object represents&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The connection object represents communication context, i.e., all communication with database is through connection object only.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;10.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;What is Statement &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Statement acts like a vehicle through which SQL commands can be sent. Through the connection object we create statement kind of objects.&lt;br /&gt;
Through the connection object we create statement kind of objects. &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 150%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;               &lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;Statement stmt  = conn.createStatement();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;This method returns object which implements statement interface. &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;1&quot; cellspacing=&quot;0&quot; style=&quot;width: 6px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;4&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td width=&quot;4&quot;&gt;&lt;ul&gt;&lt;li&gt;    &lt;/li&gt;
&lt;/ul&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;11.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;What is PreparedStatement?&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A prepared statement is an SQL statement that is precompiled by the database. Through precompilation, prepared statements improve the performance of SQL commands that are executed multiple times (given that the database supports prepared statements). Once compiled, prepared statements can be customized prior to each execution by altering predefined SQL parameters. &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 150%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt; PreparedStatement pstmt = conn.prepareStatement(&quot;UPDATE EMPLOYEES SET SALARY = ? WHERE ID = ?&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 150%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;  pstmt.setBigDecimal(1, 153833.00);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 150%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;  pstmt.setInt(2, 110592);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;Here: &lt;/i&gt;&lt;span style=&quot;color: #222222;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;i&gt;&lt;b&gt;conn&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt; is an instance of the Connection class and &lt;/i&gt;&lt;span style=&quot;color: #222222;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;i&gt;&quot;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;i&gt;?&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;i&gt;&quot;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt; represents parameters.These parameters must be specified before execution.&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.17in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;12.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;What is the difference between a Statement and a PreparedStatement?&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot; style=&quot;width: 613px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;296&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;296&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;296&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Statement&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;296&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;PreparedStatement&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A    standard Statement is used to create a Java representation of a    literal SQL statement and execute it on the database.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A    PreparedStatement is a precompiled&amp;nbsp; statement. This means    that when the PreparedStatement is executed, the RDBMS can just    run the PreparedStatement SQL statement without having to compile    it first.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Statement    has to verify its metadata against the database every time.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;While    a prepared statement has to verify its metadata against the    database only once. &lt;/span&gt;&lt;/span&gt;    &lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;If    you want to execute the SQL statement once go for STATEMENT&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;If    you want to execute a single SQL statement multiple number of    times, then go for PREPAREDSTATEMENT. PreparedStatement objects    can be reused with passing different values to the queries &lt;/span&gt;&lt;/span&gt;    &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;13.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;What are callable statements ?&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Callable statements are used from JDBC application to invoke stored procedures and functions.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;14.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;How to call a stored procedure from JDBC ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;PL/SQL stored procedures are called from within JDBC programs by means of the prepareCall() method of the Connection object created. A call to this method takes variable bind parameters as input parameters as well as output variables and creates an object instance of the CallableStatement class.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The following line of code illustrates this:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 150%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;   CallableStatement stproc_stmt = conn.prepareCall(&quot;{call procname(?,?,?)}&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Here conn is an instance of the Connection class.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;15.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;What are types of JDBC drivers?&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;There are four types of drivers defined by JDBC as follows: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Type  1: JDBC/ODBC—These require an ODBC (Open Database Connectivity)  driver for the database to be installed. This type of driver works  by translating the submitted queries into equivalent ODBC queries  and forwards them via native API calls directly to the ODBC driver.  It provides no host redirection capability.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Type2:  Native API (partly-Java driver)—This type of driver uses a  vendor-specific driver or database API to interact with the  database. An example of such an API is Oracle OCI (Oracle Call  Interface). It also provides no host redirection.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Type  3: Open Protocol-Net—This is not vendor specific and works by  forwarding database requests to a remote database source using a net  server component. How the net server component accesses the database  is transparent to the client. The client driver communicates with  the net server using a database-independent protocol and the net  server translates this protocol into database calls. This type of  driver can access any database.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Type  4: Proprietary Protocol-Net(pure Java driver)—This has a same  configuration as a type 3 driver but uses a wire protocol specific  to a particular vendor and hence can access only that vendor&#39;s  database. Again this is all transparent to the client. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Note: &lt;i&gt;Type 4 JDBC driver is most preferred kind of approach in JDBC&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;16.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Which type of JDBC driver is the fastest one&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;? &lt;/b&gt;&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;JDBC Net pure Java driver(Type IV) is the fastest driver because it converts the JDBC calls into vendor specific protocol calls and it directly interacts with the database.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;17.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Does the JDBC-ODBC Bridge support multiple concurrent open statements per connection?&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;No. You can open only one Statement object per connection when you are using the JDBC-ODBC Bridge.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;18.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Which is the right type of driver to use and when? &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Type  I driver is handy for prototyping &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Type  III driver adds security, caching, and connection control &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Type  III and Type IV drivers need no pre-installation &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;19.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;What are the standard isolation levels defined by JDBC?&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The values are defined in the class java.sql.Connection and are: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;TRANSACTION_NONE  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;TRANSACTION_READ_COMMITTED  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;TRANSACTION_READ_UNCOMMITTED  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;TRANSACTION_REPEATABLE_READ  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;TRANSACTION_SERIALIZABLE  &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Any given database may not support all of these levels.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;20.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;What is resultset ?&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The ResultSet represents set of rows retrieved due to query execution.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 1.5pt solid rgb(239, 239, 239); line-height: 150%; margin-bottom: 0in; padding: 0in 0in 0.06in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;  ResultSet rs = stmt.executeQuery(sqlQuery);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;21.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;What are the types of resultsets?&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The values are defined in the class java.sql.Connection and are: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;TYPE_FORWARD_ONLY&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  specifies that a resultset is not scrollable, that is, rows within  it can be advanced only in the forward direction. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;TYPE_SCROLL_INSENSITIVE&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  specifies that a resultset is scrollable in either direction but is  insensitive to changes committed by other transactions or other  statements in the same transaction. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;TYPE_SCROLL_SENSITIVE&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  specifies that a resultset is scrollable in either direction and is  affected by changes committed by other transactions or statements  within the same transaction. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;i&gt;Note: &lt;/i&gt;&lt;span style=&quot;color: #222222;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;&lt;i&gt;A TYPE_FORWARD_ONLY&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt; resultset is always insensitive.&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;22.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;What’s the difference between TYPE_SCROLL_INSENSITIVE and TYPE_SCROLL_SENSITIVE?&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot; style=&quot;width: 613px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;296&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;296&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;296&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;TYPE_SCROLL_INSENSITIVE&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#eff3f7&quot; width=&quot;296&quot;&gt;&lt;div align=&quot;CENTER&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;TYPE_SCROLL_SENSITIVE&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;An    insensitive&amp;nbsp; resultset is like the snapshot of the data in    the database when query was executed.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A    sensitive resultset does NOT represent a snapshot of data, rather    it contains points to those rows which satisfy the query    condition.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;After    we get the resultset the changes made to data are not visible    through the resultset, and hence they are known as insensitive.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td bgcolor=&quot;#fafafa&quot; width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;After    we obtain the resultset if the data is modified then such    modifications are visible through resultset.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Performance    not effected with insensitive.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td width=&quot;296&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Since    a trip is made for every ‘get’ operation, the performance    drastically get affected.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;22.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;What is rowset?&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A RowSet is an object that encapsulates a set of rows from either Java Database Connectivity (JDBC) result sets or tabular data sources like a file or spreadsheet. RowSets support component-based development models like JavaBeans, with a standard set of properties and an event notification mechanism.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;24.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;What are the different types&amp;nbsp; of RowSet ?&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;There are two types of RowSet are there. They are: &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Connected  - A connected RowSet object connects to the database once and  remains connected until the application terminates. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Disconnected  - A disconnected RowSet object connects to the database, executes a  query to retrieve the data from the database and then closes the  connection. A program may change the data in a disconnected RowSet  while it is disconnected. Modified data can be updated in the  database after a disconnected RowSet reestablishes the connection  with the database.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;25.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;What is the need of BatchUpdates?&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;The BatchUpdates feature allows us to group SQL statements together and send to database server in one single trip.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;26.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;What is a DataSource?&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A DataSource object is the representation of a data source in the Java programming language. In basic terms, &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in; text-indent: 0.5in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A DataSource is a facility for storing data. &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in; text-indent: 0.5in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;DataSource can be referenced by JNDI. &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in; text-indent: 0.5in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;Data Source may point to RDBMS, file System , any DBMS etc..&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;27.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;What are the advantages of DataSource?&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The few advantages of data source are : &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-left: 0.5in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;An application does not need to hardcode driver information, as it does with the &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;DriverManager.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;DataSource&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  implementations can easily change the properties of data sources.  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #414141;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;For  example&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;:  There is no need to modify the application code when making changes  to the database details. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.02in; margin-top: 0.02in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;The  DataSource facility allows developers to implement a &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,serif;&quot;&gt;DataSource&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;  class to take advantage of features like connection pooling and  distributed transactions. &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;&lt;b&gt;28.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0863a5; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;What is connection pooling? what is the main advantage of using connection pooling?&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;color: #414141; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS,serif;&quot;&gt;A connection pool is a mechanism to reuse connections created. Connection pooling can increase performance dramatically by reusing connections rather than creating a new physical connection each time a connection is requested..&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0.04in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 100%; margin-bottom: 0in; margin-top: 0.04in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/531863075631889642/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2011/10/core-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/531863075631889642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/531863075631889642'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2011/10/core-java.html' title='Core Java'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzO2gwgKZg8SrWsA4fK7XLB_Jzx20JQt6jSiBLZ6bHpoYasvGAQAGevkTa3POxlpk8aAuwl7dS-y8IlDrMeU8sVjFyyY-WVreOjqqsVbu6AJ1ZJwN4gchHnaS9njCr9jt58gs4ZduwWQ/s72-c/Try.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-7426025201952080856</id><published>2011-06-30T09:56:00.000-07:00</published><updated>2011-06-30T09:56:06.475-07:00</updated><title type='text'>Apache Axis Java Client</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;package com;&lt;br /&gt;
import javax.xml.namespace.QName;&lt;br /&gt;
import javax.xml.rpc.ParameterMode;&lt;br /&gt;
&lt;br /&gt;
import org.apache.axis.client.Call;&lt;br /&gt;
import org.apache.axis.client.Service;&lt;br /&gt;
import org.apache.axis.encoding.XMLType;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
&amp;nbsp;*&lt;br /&gt;
&amp;nbsp;* @author Vinaykumar.guntaka&lt;br /&gt;
&amp;nbsp;* jaxrpc.jar&lt;br /&gt;
&amp;nbsp;* commons-discover-0.2.jar&lt;br /&gt;
&amp;nbsp;* wsdl4j-1.5.1.jar&lt;br /&gt;
&amp;nbsp;* axis.jar&lt;br /&gt;
&amp;nbsp;*/&lt;br /&gt;
public class Demo {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static String endpoint =&amp;nbsp;&amp;nbsp; &quot;http://localhost:8080/ProjectName/services/ProjectActions&quot;;&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; invokeMethod();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; invokeParamMethod();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void invokeMethod(){&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;&amp;nbsp;&amp;nbsp; Service service = new Service();&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; QName Qname = new QName(endpoint,&quot;HelloWorld&quot;);&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; Call call = (Call) service.createCall(Qname);&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; call.setTargetEndpointAddress(new java.net.URL(endpoint));&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; call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));&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; call.setProperty(Call.SOAPACTION_URI_PROPERTY,&quot;http://localhost:8080/ProjectName/services/ProjectActions/HelloWorld&quot;);&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; call.setOperationName(new QName(&quot;http://com&quot;,&quot;HelloWorld&quot;));&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; &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; String ret = (String) call.invoke(&quot;HelloWorld&quot;, new Object[]{});&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; System.out.println(&quot;Sent &#39;Hello!&#39;, got &#39;&quot; + ret + &quot;&#39;&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (Exception e) {&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; // TODO: handle exception&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void invokeParamMethod(){&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;&amp;nbsp;&amp;nbsp; Service service = new Service();&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; QName Qname = new QName(endpoint,&quot;getMessage&quot;);&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; Call call = (Call) service.createCall(Qname);&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; call.setTargetEndpointAddress(new java.net.URL(endpoint));&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; call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));&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; call.setProperty(Call.SOAPACTION_URI_PROPERTY,&quot;http://localhost:8080/ProjectName/services/ProjectActions/getMessage&quot;);&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; call.setOperationName(new QName(&quot;http://com&quot;,&quot;getMessage&quot;));&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; call.addParameter(&quot;str&quot;, XMLType.XSD_STRING, ParameterMode.IN);&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; call.addParameter(&quot;str1&quot;, XMLType.XSD_STRING, ParameterMode.IN);&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; call.setReturnType(XMLType.XSD_STRING);&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; String ret = (String) call.invoke( new Object[] { &quot;Vinay!&quot;,&quot;Guntaka&quot; } );&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; System.out.println(&quot;got &#39;&quot; + ret + &quot;&#39;&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (Exception e) {&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; // TODO: handle exception&lt;br /&gt;
&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;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
/*******************&lt;br /&gt;
&amp;nbsp;Web service actions&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public String getMessage(String str,String str1){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return str+&quot;Vinay Guntaka&quot;+str1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public String HelloWorld(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &quot;HelloWorld Vinay Guntaka&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/7426025201952080856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2011/06/apache-axis-java-client.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/7426025201952080856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/7426025201952080856'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2011/06/apache-axis-java-client.html' title='Apache Axis Java Client'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-1002481285026230875</id><published>2011-05-25T10:23:00.000-07:00</published><updated>2011-05-25T10:23:25.272-07:00</updated><title type='text'>Spring Vs Struts</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:TrackMoves/&gt;   &lt;w:TrackFormatting/&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:DoNotPromoteQF/&gt;   &lt;w:LidThemeOther&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:LidThemeAsian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:LidThemeComplexScript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:SplitPgBreakAndParaMark/&gt;    &lt;w:DontVertAlignCellWithSp/&gt;    &lt;w:DontBreakConstrainedForcedTables/&gt;    &lt;w:DontVertAlignInTxbx/&gt;    &lt;w:Word11KerningPairs/&gt;    &lt;w:CachedColBalance/&gt;   &lt;/w:Compatibility&gt;   &lt;m:mathPr&gt;    &lt;m:mathFont m:val=&quot;Cambria Math&quot;/&gt;    &lt;m:brkBin m:val=&quot;before&quot;/&gt;    &lt;m:brkBinSub m:val=&quot;--&quot;/&gt;    &lt;m:smallFrac m:val=&quot;off&quot;/&gt;    &lt;m:dispDef/&gt;    &lt;m:lMargin m:val=&quot;0&quot;/&gt;    &lt;m:rMargin m:val=&quot;0&quot;/&gt;    &lt;m:defJc m:val=&quot;centerGroup&quot;/&gt;    &lt;m:wrapIndent m:val=&quot;1440&quot;/&gt;    &lt;m:intLim m:val=&quot;subSup&quot;/&gt;    &lt;m:naryLim m:val=&quot;undOvr&quot;/&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; DefUnhideWhenUsed=&quot;true&quot;
  DefSemiHidden=&quot;true&quot; DefQFormat=&quot;false&quot; DefPriority=&quot;99&quot;
  LatentStyleCount=&quot;267&quot;&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;0&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Normal&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;heading 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 7&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 8&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 9&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 7&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 8&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 9&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;35&quot; QFormat=&quot;true&quot; Name=&quot;caption&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;10&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Title&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;1&quot; Name=&quot;Default Paragraph Font&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;11&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Subtitle&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;22&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Strong&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;20&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Emphasis&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;59&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Table Grid&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; UnhideWhenUsed=&quot;false&quot; Name=&quot;Placeholder Text&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;1&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;No Spacing&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; UnhideWhenUsed=&quot;false&quot; Name=&quot;Revision&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;34&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;List Paragraph&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;29&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Quote&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;30&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Intense Quote&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;19&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Subtle Emphasis&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;21&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Intense Emphasis&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;31&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Subtle Reference&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;32&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Intense Reference&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;33&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Book Title&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;37&quot; Name=&quot;Bibliography&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; QFormat=&quot;true&quot; Name=&quot;TOC Heading&quot;/&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-priority:99;
 mso-style-qformat:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin-top:0in;
 mso-para-margin-right:0in;
 mso-para-margin-bottom:10.0pt;
 mso-para-margin-left:0in;
 line-height:115%;
 mso-pagination:widow-orphan;
 font-size:11.0pt;
 font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
 mso-ascii-font-family:Calibri;
 mso-ascii-theme-font:minor-latin;
 mso-fareast-font-family:&quot;Times New Roman&quot;;
 mso-fareast-theme-font:minor-fareast;
 mso-hansi-font-family:Calibri;
 mso-hansi-theme-font:minor-latin;}
&lt;/style&gt; &lt;![endif]--&gt;&lt;span style=&quot;font-family: &amp;quot;Cambria&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 16.0pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: major-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: major-bidi; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-US; mso-fareast-theme-font: major-fareast; mso-hansi-theme-font: major-latin;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Differences between Struts and Springs&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:TrackMoves/&gt;   &lt;w:TrackFormatting/&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:DoNotPromoteQF/&gt;   &lt;w:LidThemeOther&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:LidThemeAsian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:LidThemeComplexScript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:SplitPgBreakAndParaMark/&gt;    &lt;w:DontVertAlignCellWithSp/&gt;    &lt;w:DontBreakConstrainedForcedTables/&gt;    &lt;w:DontVertAlignInTxbx/&gt;    &lt;w:Word11KerningPairs/&gt;    &lt;w:CachedColBalance/&gt;   &lt;/w:Compatibility&gt;   &lt;m:mathPr&gt;    &lt;m:mathFont m:val=&quot;Cambria Math&quot;/&gt;    &lt;m:brkBin m:val=&quot;before&quot;/&gt;    &lt;m:brkBinSub m:val=&quot;--&quot;/&gt;    &lt;m:smallFrac m:val=&quot;off&quot;/&gt;    &lt;m:dispDef/&gt;    &lt;m:lMargin m:val=&quot;0&quot;/&gt;    &lt;m:rMargin m:val=&quot;0&quot;/&gt;    &lt;m:defJc m:val=&quot;centerGroup&quot;/&gt;    &lt;m:wrapIndent m:val=&quot;1440&quot;/&gt;    &lt;m:intLim m:val=&quot;subSup&quot;/&gt;    &lt;m:naryLim m:val=&quot;undOvr&quot;/&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; DefUnhideWhenUsed=&quot;true&quot;
  DefSemiHidden=&quot;true&quot; DefQFormat=&quot;false&quot; DefPriority=&quot;99&quot;
  LatentStyleCount=&quot;267&quot;&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;0&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Normal&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;heading 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 7&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 8&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 9&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 7&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 8&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 9&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;35&quot; QFormat=&quot;true&quot; Name=&quot;caption&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;10&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Title&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;1&quot; Name=&quot;Default Paragraph Font&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;11&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Subtitle&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;22&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Strong&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;20&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Emphasis&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;59&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Table Grid&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; UnhideWhenUsed=&quot;false&quot; Name=&quot;Placeholder Text&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;1&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;No Spacing&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; UnhideWhenUsed=&quot;false&quot; Name=&quot;Revision&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;34&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;List Paragraph&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;29&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Quote&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;30&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Intense Quote&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;19&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Subtle Emphasis&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;21&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Intense Emphasis&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;31&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Subtle Reference&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;32&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Intense Reference&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;33&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Book Title&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;37&quot; Name=&quot;Bibliography&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; QFormat=&quot;true&quot; Name=&quot;TOC Heading&quot;/&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-priority:99;
 mso-style-qformat:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin-top:0in;
 mso-para-margin-right:0in;
 mso-para-margin-bottom:10.0pt;
 mso-para-margin-left:0in;
 line-height:115%;
 mso-pagination:widow-orphan;
 font-size:11.0pt;
 font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
 mso-ascii-font-family:Calibri;
 mso-ascii-theme-font:minor-latin;
 mso-hansi-font-family:Calibri;
 mso-hansi-theme-font:minor-latin;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Springs:&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Dependency Injection&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Inversion of Control&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Transaction Management&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Aspect Oriented Programming&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;DB Connection Control&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Model View Controller (&lt;/b&gt;this is small part that is somehow comparable with &lt;strong&gt;&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: minor-bidi; mso-hansi-theme-font: minor-latin;&quot;&gt;Struts&lt;/span&gt;&lt;/strong&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;)&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Spring Web flow (define control flows). &lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Spring is made up of many components, main component being the core container (Beans, BeanFactory, Application Context, etc) that provide the Dependency injection via a lightweight container, and the rest of the components (e.g. AOP, Transaction Management, etc.) are built around it.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;strong&gt;&lt;u&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: minor-bidi; mso-hansi-theme-font: minor-latin;&quot;&gt;Apache Struts&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt; is an open-source web application framework for developing Java EE web applications. It uses and extends the Java Servlet API to encourage developers to adopt a model-view-controller (MVC) architecture.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;&lt;span style=&quot;mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Spring is much more than Struts. Web MVC is just a small subset of the capabilities that Spring provides.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;&lt;span style=&quot;mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Struts is one of the first web MVC frameworks based on servlets and JSPs&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;&lt;span style=&quot;mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Spring is a Java EE application framework based on Inversion of Control (IoC) and aspect-oriented programming (AOP). &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;&lt;span style=&quot;mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Spring has a web MVC module that&#39;s analogous to Struts. &lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;Spring can also use Struts as its web MVC module.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Struts are basically a request based framework while spring is a component based framework. All the benefits of struts can be achieved through spring (Spring MVC). Spring has many modules which helps you develop enterprise application with different components like ORM, AOP, MVC, and Transaction management etc., With Spring 3.0 it has an inbuilt support for restful services too. Also spring portfolio has other project which seamlessly integrates with spring like spring security (Acegi security), osgi, spring web services and all. Over all spring offers more benefits than struts in developing a quality applications by enforcing good design and decoupled components&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 2;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;12 BENEFITS of Spring MVC over&amp;nbsp;Struts&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;Spring is a powerful Java application framework, used in a wide range of Java applications. It provides enterprise services to Plain Old Java Objects (POJOs). Spring uses dependency injection to achieve simplification and increase testability.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;1. Spring provides a very clean division between controllers, JavaBeans models, and views.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;2. Spring’s MVC is very flexible. Unlike Struts, which forces your Action and Form objects into concrete inheritance (thus taking away your single shot at concrete inheritance in Java), Spring MVC is entirely based on interfaces. Furthermore, just about every part of the Spring MVC framework is configurable via plugging in your own interface. Of course we also provide convenience classes as an implementation option.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;3. Spring, like WebWork, provides interceptors as well as controllers, making it easy to factor out behavior common to the handling of many requests.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;4. Spring MVC is truly view-agnostic. You don’t get pushed to use JSP if you don’t want to; you can use Velocity, XLST or other view technologies. If you want to use a custom view mechanism&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;– for example, your own templating language – you can easily implement the Spring View interface to integrate it.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;5. Spring Controllers are configured via IoC like any other objects. This makes them easy to test, and beautifully integrated with other objects managed by Spring.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;6. Spring MVC web tiers are typically easier to test than Struts web tiers, due to the avoidance of forced concrete inheritance and explicit dependence of controllers on the dispatcher servlet.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;7. The web tier becomes a thin layer on top of a business object layer. This encourages good practice. Struts and other dedicated web frameworks leave you on your own in implementing your business objects; Spring provides an integrated framework for all tiers of your application.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;8. No ActionForms. Bind directly to domain objects&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;9. More testable code (validation has no dependency on Servlet API)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;10. Struts imposes dependencies on your Controllers (they must extend a Struts class), Spring doesn’t force you to do this although there are convenience Controller implementations that you can choose to extend.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;11. Spring has a well defined interface to business layer&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;12. Spring offers better integration with view technologies other than JSP (Velocity / XSLT / Free Marker / XL etc.)&lt;/span&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: 11.0pt;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/1002481285026230875/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2011/05/spring-vs-struts.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/1002481285026230875'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/1002481285026230875'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2011/05/spring-vs-struts.html' title='Spring Vs Struts'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-4071963542428426439</id><published>2011-05-10T17:38:00.000-07:00</published><updated>2011-05-10T17:38:51.898-07:00</updated><title type='text'>Collection FrameWork in Java</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Concrete Collections&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
--------------------&lt;br /&gt;
&lt;br /&gt;
Concrete Collection &amp;nbsp; &amp;nbsp; Implements &amp;nbsp;description&lt;br /&gt;
&lt;br /&gt;
HashSet &amp;nbsp; &amp;nbsp; &amp;nbsp; Set &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Hashtable&lt;br /&gt;
TreeSet &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SortedSet &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Balance binary Tree&lt;br /&gt;
ArrayList &amp;nbsp; &amp;nbsp; &amp;nbsp;List &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Re-sizable array&lt;br /&gt;
LinkedList &amp;nbsp; &amp;nbsp;List &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LinkedList&lt;br /&gt;
Vector &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;List &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;re-sizable array&lt;br /&gt;
HashMap &amp;nbsp; &amp;nbsp; Map &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hashtable&lt;br /&gt;
TreeMap &amp;nbsp; &amp;nbsp; &amp;nbsp;SortedMap &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;balance binary tree&lt;br /&gt;
HashTable &amp;nbsp; &amp;nbsp;Map &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;hashtable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
&amp;nbsp;*&lt;br /&gt;
&amp;nbsp;*/&lt;br /&gt;
package com.jit;&lt;br /&gt;
&lt;br /&gt;
import java.util.ArrayList;&lt;br /&gt;
import java.util.HashMap;&lt;br /&gt;
import java.util.HashSet;&lt;br /&gt;
import java.util.Hashtable;&lt;br /&gt;
import java.util.LinkedList;&lt;br /&gt;
import java.util.List;&lt;br /&gt;
import java.util.ListIterator;&lt;br /&gt;
import java.util.Map;&lt;br /&gt;
import java.util.Set;&lt;br /&gt;
import java.util.TreeMap;&lt;br /&gt;
import java.util.TreeSet;&lt;br /&gt;
import java.util.Vector;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
&amp;nbsp;* @author Vinay Guntaka&lt;br /&gt;
&amp;nbsp;* Factors of Collection Framework to be considered&lt;br /&gt;
&amp;nbsp;* API&lt;br /&gt;
&amp;nbsp;* Synchronization&lt;br /&gt;
&amp;nbsp;* Data growth&lt;br /&gt;
&amp;nbsp;* Usage patterns&lt;br /&gt;
&amp;nbsp;*/&lt;br /&gt;
public class CollectionFrameWork {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public static void main(String[] args) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getHashSet();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getTreeSet();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getArrayList();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getLinkedList();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getVectorList();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getHashMap();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getHashTable();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getTreeMap();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; /*&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* Unordered (A HashSet use the hash function to store the values)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* No Duplicates&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* Allow Null&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public static void getHashSet()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Set&amp;lt;String&amp;gt; hs = new HashSet&amp;lt;String&amp;gt;();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hs.add(&quot;Vinay&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hs.add(&quot;Vinay&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hs.add(&quot;Kumar&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hs.add(&quot;Guntaka&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hs.add(null);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(hs);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; /* &amp;nbsp;A TreeSet is more efficient in case of search element.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* &amp;nbsp;null throws NullPointerException&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* &amp;nbsp;By Default Sorted&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* &amp;nbsp;No Duplicates&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public static void getTreeSet()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Set&amp;lt;String&amp;gt; ts = new TreeSet&amp;lt;String&amp;gt;();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ts.add(&quot;Vinay&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ts.add(&quot;Vinay&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ts.add(&quot;Kumar&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ts.add(&quot;Guntaka&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ts.add(&quot;&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(ts);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; /**&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* If you need to support random access, without inserting or removing&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* elements from any place other than the end, then ArrayList offers the optimal collection.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* If, however, you need to frequently add and remove elements from the middle of the list and&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* only access the list elements sequentially, then LinkedList offers the better implementation.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;*&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; /*&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* Ordered&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* Allows Null&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* Allows Duplicates&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* Iterating from To-And-Fro Directions&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* Not Synchronized&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public static void getArrayList(){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; List&amp;lt;String&amp;gt; al= new ArrayList&amp;lt;String&amp;gt;();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; al.add(&quot;Vinay&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; al.add(null);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; al.add(&quot;Vinay&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; al.add(&quot;Guntaka&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(al);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Iterating from Back Side&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ListIterator&amp;lt;String&amp;gt; lsitr = al.listIterator(al.size());&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while(lsitr.hasPrevious()){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(lsitr.previous());&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Iterating from front Side&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while(lsitr.hasNext()){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(lsitr.next());&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; al.subList(0, 2).clear();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(al);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; /**&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* In a LinkedList, each element is linked to its previous and next element making&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* it easier to delete or insert in the middle of the list&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public static void getLinkedList(){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; List&amp;lt;String&amp;gt; ll= new LinkedList&amp;lt;String&amp;gt;();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ll.add(&quot;Vinay&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ll.add(null);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ll.add(&quot;Vinay&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ll.add(&quot;Guntaka&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(ll);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; /*&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* Synchronized&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public static void getVectorList(){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Vector&amp;lt;String&amp;gt; v = new Vector&amp;lt;String&amp;gt;();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; v.add(&quot;Vinay&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; v.add(&quot;Kumar&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; v.add(null);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; v.add(&quot;Guntaka&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; v.add(&quot;Guntaka&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(v);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; /*&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* Key Name should be Unique&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* Unidentified Order&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* UnSynchronized&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* The values can be null.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public static void getHashMap(){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Map&amp;lt;String,String&amp;gt; hm = new HashMap&amp;lt;String, String&amp;gt;();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hm.put(&quot;FName&quot;, &quot;Vinay&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hm.put(&quot;MName&quot;, &quot;Kumar&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hm.put(&quot;LName&quot;, &quot;Guntaka&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hm.put(&quot;MName&quot;, null);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(hm);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; /*&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* Key Name should be Unique&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* Does not let you have null value for key.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* Synchronized&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public static void getHashTable(){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Map&amp;lt;String,Integer&amp;gt; ht = new Hashtable&amp;lt;String, Integer&amp;gt;();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ht.put(&quot;FName&quot;, 100);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ht.put(&quot;MName&quot;, 99);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ht.put(&quot;LName&quot;, 101);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ht.put(&quot;Name&quot;, 152);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(ht);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; /*&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* The values can be null. But the key should be unique&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* UnSynchronized&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public static void getTreeMap(){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Map&amp;lt;String,Integer&amp;gt; tm = new TreeMap&amp;lt;String, Integer&amp;gt;();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tm.put(&quot;FName&quot;, 100);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tm.put(&quot;MName&quot;, 99);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tm.put(&quot;LName&quot;, 101);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tm.put(&quot;Name&quot;, null);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(tm);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/4071963542428426439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2011/05/collection-framework-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/4071963542428426439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/4071963542428426439'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2011/05/collection-framework-in-java.html' title='Collection FrameWork in Java'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-4140714021663427295</id><published>2011-05-07T19:00:00.000-07:00</published><updated>2011-05-07T19:00:32.327-07:00</updated><title type='text'>Google Maps on Android Mobile / Simulator</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;Loading the Google Maps on Android Mobile / Simulator&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Follow the following link to generate the map key&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
http://code.google.com/android/add-ons/google-apis/mapkey.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Command to load the debug.keystore&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
C:\Java\jre\bin&amp;gt;keytool.exe -list -alias androiddebugkey -keystore &quot;C:\Documents and Settings\jit\.android\debug.keystore&quot; -storepass android -keypass android&lt;br /&gt;
&lt;br /&gt;
on Enter you will get a privateKeyEntry with Certficate FingerPrint (MD5)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Once the MD5 finger print is generated&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Registering the Certificate Fingerprint with the Google Maps Service&lt;br /&gt;
http://code.google.com/android/maps-api-signup.html&lt;br /&gt;
&lt;br /&gt;
Note: Make sure the simluator is set to Google 2.X API&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Program to Load Google MAP on Android&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------&lt;br /&gt;
main.xml&lt;br /&gt;
--------------------------------------&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;
&amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:orientation=&quot;vertical&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:layout_width=&quot;fill_parent&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:layout_height=&quot;fill_parent&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;gt;&lt;br /&gt;
&amp;lt;com.google.android.maps.MapView&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:id=&quot;@+id/webview&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_width=&quot;fill_parent&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_height=&quot;fill_parent&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:clickable=&quot;true&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:enabled=&quot;true&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:apiKey=&quot;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; /&amp;gt;&lt;br /&gt;
&amp;lt;/LinearLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------&lt;br /&gt;
AndroidManifest.xml&lt;br /&gt;
----------------------------------------&lt;br /&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;
&amp;lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; package=&quot;com.jit&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; android:versionCode=&quot;1&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; android:versionName=&quot;1.0&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;application android:icon=&quot;@drawable/icon&quot; android:label=&quot;@string/app_name&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;uses-library android:name=&quot;com.google.android.maps&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;activity android:name=&quot;.GMap&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:label=&quot;@string/app_name&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;intent-filter&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;action android:name=&quot;android.intent.action.MAIN&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/intent-filter&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/activity&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/application&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;lt;uses-permission android:name=&quot;android.permission.INTERNET&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;uses-permission android:name=&quot;android.permission.ACCESS_COARSE_LOCATION&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;uses-permission android:name=&quot;android.permission.ACCESS_FINE_LOCATION&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;lt;uses-permission android:name=&quot;android.permission.ACCESS_LOCATION_EXTRA_COMMANDS&quot;&amp;gt;&amp;lt;/uses-permission&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/manifest&amp;gt;&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------&lt;br /&gt;
GMAP.Java&lt;br /&gt;
-------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
package com.jit;&lt;br /&gt;
/*&lt;br /&gt;
&amp;nbsp;* @author: Vinay Guntaka&lt;br /&gt;
&amp;nbsp;*/&lt;br /&gt;
import android.os.Bundle;&lt;br /&gt;
import android.view.MotionEvent;&lt;br /&gt;
import android.widget.Toast;&lt;br /&gt;
&lt;br /&gt;
import com.google.android.maps.GeoPoint;&lt;br /&gt;
import com.google.android.maps.MapController;&lt;br /&gt;
import com.google.android.maps.MapView;&lt;br /&gt;
&lt;br /&gt;
public class GMap extends com.google.android.maps.MapActivity{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; MapController mMapController;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; MapView mMapView;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; GeoPoint p;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; /** Called when the activity is first created. */&lt;br /&gt;
&amp;nbsp; &amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setContentView(R.layout.main);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mMapView = (MapView) findViewById(R.id.webview);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mMapView.setBuiltInZoomControls(true);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mMapView.setSatellite(true);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mMapController = mMapView.getController();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mMapController.setZoom(15);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //mMapView.setSatellite(true);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mMapView.setStreetView(true);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String coordinates[] = {&quot;1.352566007&quot;, &quot;103.78921587&quot;};&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; double lat = Double.parseDouble(coordinates[0]);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; double lng = Double.parseDouble(coordinates[1]);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p = new GeoPoint(&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (int) (lat * 1E6),&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (int) (lng * 1E6));&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mMapController.animateTo(p);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mMapController.setZoom(17);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mMapView.invalidate();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/* MyOverlays myOverlays = new MyOverlays(this.getResources().getDrawable(R.drawable.icon), this);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OverlayItem tempOverlayItem = new OverlayItem(new GeoPoint(17000000,78000000), &quot;NewActivity&quot;, &quot;Welcome to New Activity&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tempOverlayItem.setMarker(this.getResources().getDrawable(R.drawable.icon));&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; myOverlays.addOverlay(tempOverlayItem);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mMapView.getOverlays().add(myOverlays);*/&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public boolean onTouchEvent(MotionEvent event) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Toast.makeText(this, &quot;Ooops! I am touched&quot;, Toast.LENGTH_LONG).show();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return super.onTouchEvent(event);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp; &amp;nbsp; protected boolean isRouteDisplayed() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // TODO Auto-generated method stub&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
------------------------------------------&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/4140714021663427295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2011/05/google-maps-on-android-mobile-simulator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/4140714021663427295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/4140714021663427295'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2011/05/google-maps-on-android-mobile-simulator.html' title='Google Maps on Android Mobile / Simulator'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-6052370223641499059</id><published>2011-05-07T18:35:00.000-07:00</published><updated>2011-05-07T18:35:29.010-07:00</updated><title type='text'>Ajax Programming setup instructions</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Ajax Programming :&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&amp;gt;&lt;br /&gt;
&amp;lt;HTML&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;lt;HEAD&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;TITLE&amp;gt; New Document &amp;lt;/TITLE&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;META NAME=&quot;Generator&quot; CONTENT=&quot;EditPlus&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;META NAME=&quot;Author&quot; CONTENT=&quot;&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;META NAME=&quot;Keywords&quot; CONTENT=&quot;&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;META NAME=&quot;Description&quot; CONTENT=&quot;&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;lt;/HEAD&amp;gt;&lt;br /&gt;
&amp;lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; // function to create an XMLHttpClient in a cross-browser manner&lt;br /&gt;
&amp;nbsp; function getAJAXRequest() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; var xmlhttp=null;; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; try {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Mozilla / Safari / IE7&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlhttp = new XMLHttpRequest();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (e) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// IE&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var XMLHTTP_IDS = new Array(&#39;MSXML2.XMLHTTP.5.0&#39;,&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;&#39;MSXML2.XMLHTTP.4.0&#39;,&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;&#39;MSXML2.XMLHTTP.3.0&#39;,&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;&#39;MSXML2.XMLHTTP&#39;,&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;&#39;Microsoft.XMLHTTP&#39; );&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var success = false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (var i=0;i &amp;lt; XMLHTTP_IDS.length &amp;amp;&amp;amp; !success; i++) {&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; &amp;nbsp;xmlhttp = new ActiveXObject(XMLHTTP_IDS[i]);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;success = true;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;break;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (e) {}&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (!success) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return null;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;return xmlhttp;&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;function loadAjaxCall(){&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var http_request=getAJAXRequest();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; //open(method,url,async) &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; //Specifies the type of request, the URL, and if the request should be handled asynchronously or not.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; //method: the type of request: GET or POST&lt;br /&gt;
&amp;nbsp; &amp;nbsp; //url: the location of the file on the server&lt;br /&gt;
&amp;nbsp; &amp;nbsp; //async: true (asynchronous) or false (synchronous)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var parameters=&quot;one=&quot;+FristVal+&quot;&amp;amp;sec=&quot;+SecVal;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; //Note: When you use async=false, do NOT write an onreadystatechange function - just put the code after the send() statement:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; //Note: When using async=true, specify a function to execute when the response is ready in the onreadystatechange event:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; http_request.open(&#39;POST&#39;, &quot;/projectName/SomeAction.do&quot;, false);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; http_request.setRequestHeader(&quot;Content-type&quot;, &quot;application/x-www-form-urlencoded&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; http_request.setRequestHeader(&quot;Content-length&quot;, parameters.length);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; http_request.setRequestHeader(&quot;Connection&quot;, &quot;close&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; http_request.send(parameters);&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; // here the state is synch&lt;br /&gt;
&amp;nbsp; &amp;nbsp; // getting the response as responseText or responseXML&lt;br /&gt;
&amp;nbsp; &amp;nbsp; document.getElementById(&quot;myDiv&quot;).innerHTML=xmlhttp.responseText;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; /*&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* Suppose if Asynch we are have to set the readyState&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // here the response is in ready state&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xmlhttp.onreadystatechange=function()&lt;br /&gt;
&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;if (xmlhttp.readyState==4 &amp;amp;&amp;amp; xmlhttp.status==200)&lt;br /&gt;
&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;document.getElementById(&quot;myDiv&quot;).innerHTML=xmlhttp.responseText;&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;}&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;
&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
// onreadystatechange &amp;nbsp; &amp;nbsp; Stores a function (or the name of a function) to be called automatically each time the readyState property changes&lt;br /&gt;
//readyState :-&lt;br /&gt;
//Holds the status of the XMLHttpRequest. Changes from 0 to 4:&lt;br /&gt;
&lt;br /&gt;
//0: request not initialized&lt;br /&gt;
//1: server connection established&lt;br /&gt;
//2: request received&lt;br /&gt;
//3: processing request&lt;br /&gt;
//4: request finished and response is ready&lt;br /&gt;
&lt;br /&gt;
//status:-&lt;br /&gt;
//200: &quot;OK&quot;&lt;br /&gt;
//404: Page not found&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;lt;BODY&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;lt;/BODY&amp;gt;&lt;br /&gt;
&amp;lt;/HTML&amp;gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/6052370223641499059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2011/05/ajax-programming-setup-instructions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/6052370223641499059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/6052370223641499059'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2011/05/ajax-programming-setup-instructions.html' title='Ajax Programming setup instructions'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-1518543631615044123</id><published>2011-05-07T18:31:00.000-07:00</published><updated>2011-10-30T11:47:30.288-07:00</updated><title type='text'>Captcha Programming</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Captcha Programming in Java&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
package com.jit;&lt;br /&gt;
&lt;br /&gt;
import java.awt.Color;&lt;br /&gt;
import java.awt.Font;&lt;br /&gt;
import java.awt.FontMetrics;&lt;br /&gt;
import java.awt.Graphics2D;&lt;br /&gt;
import java.awt.geom.AffineTransform;&lt;br /&gt;
import java.awt.image.BufferedImage;&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import java.util.Iterator;&lt;br /&gt;
&lt;br /&gt;
import javax.imageio.IIOImage;&lt;br /&gt;
import javax.imageio.ImageIO;&lt;br /&gt;
import javax.imageio.ImageWriteParam;&lt;br /&gt;
import javax.imageio.ImageWriter;&lt;br /&gt;
import javax.servlet.ServletException;&lt;br /&gt;
import javax.servlet.http.HttpServlet;&lt;br /&gt;
import javax.servlet.http.HttpServletRequest;&lt;br /&gt;
import javax.servlet.http.HttpServletResponse;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
&amp;nbsp;* @author Vinay Guntaka&lt;br /&gt;
&amp;nbsp;* Servlet implementation class CaptchaServlet&lt;br /&gt;
&amp;nbsp;*/&lt;br /&gt;
public class CaptchaServlet extends HttpServlet {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private static final long serialVersionUID = 1L;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; /**&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* @see HttpServlet#HttpServlet()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public CaptchaServlet() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; /**&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&amp;nbsp; &amp;nbsp; protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; createCatcha(request, response);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; /**&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&amp;nbsp; &amp;nbsp; protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; createCatcha(request, response);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; @SuppressWarnings(&quot;unchecked&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; protected void createCatcha(HttpServletRequest request,HttpServletResponse response)throws ServletException, IOException {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; response.setContentType(&quot;image/jpg&quot;);&lt;br /&gt;
&lt;br /&gt;
&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; Color textColor = Color.white;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Font textFont = new Font(&quot;Georgia&quot;, Font.PLAIN, 18);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int charsToPrint = 6;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int width = 125;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int height = 28;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; float horizMargin = 20.0f;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; float imageQuality = 0.95f; // max is 1.0 (this is for jpeg)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; double rotationRange = 0.7; // this is radians&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BufferedImage bufferedImage = new BufferedImage(width, height,BufferedImage.TYPE_INT_RGB);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Graphics2D g = (Graphics2D) bufferedImage.getGraphics();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Draw an oval&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g.setColor(new Color(255, 153, 0));&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g.fillRect(0, 0, width, height);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g.setColor(textColor);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g.setFont(textFont);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FontMetrics fontMetrics = g.getFontMetrics();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int maxAdvance = fontMetrics.getMaxAdvance();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int fontHeight = fontMetrics.getHeight();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // i removed 1 and l and i because there are confusing to users...&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Z, z, and N also get confusing when rotated&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // 0, O, and o are also confusing...&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // lowercase G looks a lot like a 9 so i killed it&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // this should ideally be done for every language...&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // i like controlling the characters though because it helps prevent&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // confusion&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String elegibleChars = &quot;ABCDEFGHJKLMPQRSTUVWXYabcdefhjkmnpqrstuvwxy23456789&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; char[] chars = elegibleChars.toCharArray();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; float spaceForLetters = -horizMargin * 2 + width;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; float spacePerChar = spaceForLetters / (charsToPrint - 1.0f);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; StringBuffer finalString = new StringBuffer();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; charsToPrint; i++) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; double randomValue = Math.random();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int randomIndex = (int) Math.round(randomValue*(chars.length - 1));&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; char characterToShow = chars[randomIndex];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; finalString.append(characterToShow);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int charWidth = fontMetrics.charWidth(characterToShow);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int charDim = Math.max(maxAdvance, fontHeight);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int halfCharDim = (int) (charDim / 2);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BufferedImage charImage = new BufferedImage(charDim, charDim,BufferedImage.TYPE_INT_ARGB);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Graphics2D charGraphics = charImage.createGraphics();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; charGraphics.translate(halfCharDim, halfCharDim);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; double angle = (Math.random() - 0.5) * rotationRange;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; charGraphics.transform(AffineTransform.getRotateInstance(angle));&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; charGraphics.translate(-halfCharDim, -halfCharDim);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; charGraphics.setColor(textColor);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; charGraphics.setFont(textFont);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int charX = (int) (0.5 * charDim - 0.5 * charWidth);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; charGraphics.drawString(&quot;&quot; + characterToShow,charX,&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; (int) ((charDim - fontMetrics.getAscent()) / 2 + fontMetrics&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; .getAscent()));&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; float x = horizMargin + spacePerChar * (i) - charDim / 2.0f;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int y = (int) ((height - charDim) / 2);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g.drawImage(charImage, (int) x, y, charDim, charDim,null, null);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; charGraphics.dispose();&lt;br /&gt;
&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; // Write the image as a jpg&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Iterator iter = ImageIO.getImageWritersByFormatName(&quot;JPG&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (iter.hasNext()) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ImageWriter writer = (ImageWriter) iter.next();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ImageWriteParam iwp = writer.getDefaultWriteParam();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iwp.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iwp.setCompressionQuality(imageQuality);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; writer.setOutput(ImageIO.createImageOutputStream(response.getOutputStream()));&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IIOImage imageIO = new IIOImage(bufferedImage, null, null);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; writer.write(null, imageIO, iwp);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; throw new RuntimeException(&quot;no encoder found for jsp&quot;);&lt;br /&gt;
&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; // let&#39;s stick the final string in the session&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; request.getSession().setAttribute(&quot;captcha&quot;, finalString.toString());&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g.dispose();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (IOException ioe) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; throw new RuntimeException(&quot;Unable to build image&quot;, ioe);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
----------------------------------&lt;br /&gt;
Captcha.jsp&lt;br /&gt;
&lt;br /&gt;
&amp;lt;%@page contentType=&quot;text/html&quot; pageEncoding=&quot;UTF-8&quot;%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&amp;gt;&lt;br /&gt;
&amp;lt;title&amp;gt;Captcha&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot;&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;form method=&quot;post&quot;&amp;gt;&lt;br /&gt;
&amp;lt;table cellspacing=&quot;15&quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Are you human?&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;input type=&quot;text&quot; name=&quot;code&quot;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;img src=&quot;CaptchaServlet&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;input type=&quot;submit&quot; value=&quot;submit&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;%&lt;br /&gt;
&amp;nbsp; String captcha = (String) session.getAttribute(&quot;captcha&quot;);&lt;br /&gt;
&amp;nbsp; String code = (String) request.getParameter(&quot;code&quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; if (captcha != null &amp;amp;&amp;amp; code != null) {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Captcha Code:&quot;+captcha);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Code:&quot;+code);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if (captcha.equals(code)) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; out.print(&quot;&amp;lt;p class=&#39;alert&#39;&amp;gt;Correct&amp;lt;/p&amp;gt;&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; } else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; out.print(&quot;&amp;lt;p class=&#39;alert&#39;&amp;gt;Incorrect&amp;lt;/p&amp;gt;&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
%&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--------------------------------&lt;br /&gt;
web.xml&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&lt;br /&gt;
&amp;lt;web-app xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot; xmlns:web=&quot;http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot; xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot; id=&quot;WebApp_ID&quot; version=&quot;2.5&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;display-name&amp;gt;Captcha&amp;lt;/display-name&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;welcome-file-list&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;welcome-file&amp;gt;captcha.jsp&amp;lt;/welcome-file&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/welcome-file-list&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;servlet&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;description&amp;gt;&amp;lt;/description&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;display-name&amp;gt;CaptchaServlet&amp;lt;/display-name&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;servlet-name&amp;gt;CaptchaServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;servlet-class&amp;gt;com.jit.CaptchaServlet&amp;lt;/servlet-class&amp;gt;;&lt;br /&gt;
&amp;nbsp; &amp;lt;/servlet&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;servlet-name&amp;gt;CaptchaServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;url-pattern&amp;gt;/CaptchaServlet&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;
&amp;lt;/web-app&amp;gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-style: italic; font-weight: bold;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/1518543631615044123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2011/05/captcha-programming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/1518543631615044123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/1518543631615044123'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2011/05/captcha-programming.html' title='Captcha Programming'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-111381614523269739</id><published>2011-04-23T21:25:00.000-07:00</published><updated>2011-04-24T17:56:11.240-07:00</updated><title type='text'>Configure JNDI Connection Pooling:</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div&gt;&lt;i style=&quot;color: #274e13;&quot;&gt;Configure JNDI Connection Pooling:&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
For establishing the  connection pool i have created a dynamic web-project with SampleConn,  with MySql Database and loggers. So, make sure we have the mysql.jar in  tomcat working lib directory and log4j.jar in your project library.&lt;br /&gt;
&lt;br /&gt;
Here i am listing out the steps to follow:&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------------------------------------&lt;br /&gt;
Step 1) Configure web.xml file &lt;br /&gt;
&lt;br /&gt;
Here i am invoking a servlet on startup of server (GetConnPool)&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&lt;br /&gt;
&amp;lt;web-app  xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;  xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot;  xmlns:web=&quot;http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot;  xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot; id=&quot;WebApp_ID&quot; version=&quot;2.5&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;display-name&amp;gt;SampleConn&amp;lt;/display-name&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;resource-ref&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;description&amp;gt;DB Connection&amp;lt;/description&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;res-ref-name&amp;gt;jdbc/JIT&amp;lt;/res-ref-name&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;res-type&amp;gt;javax.sql.DataSource&amp;lt;/res-type&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;res-auth&amp;gt;Container&amp;lt;/res-auth&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/resource-ref&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;servlet&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;servlet-name&amp;gt;Connection&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;servlet-class&amp;gt;com.jit.servlets.GetConnPool&amp;lt;/servlet-class&amp;gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;load-on-startup&amp;gt;1&amp;lt;/load-on-startup&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/servlet&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;welcome-file-list&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;welcome-file&amp;gt;index.jsp&amp;lt;/welcome-file&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/welcome-file-list&amp;gt;&lt;br /&gt;
&amp;lt;/web-app&amp;gt;&lt;br /&gt;
----------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Step 2) Create a context.xml in META-INF of your Project&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Context privileged=&quot;true&quot; antiResourceLocking=&quot;false&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; antiJARLocking=&quot;false&quot; debug=&quot;1&quot; reloadable=&quot;true&quot; path=&quot;&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;!-- maxActive: Maximum number of dB connections in pool. Make sure you&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; configure your mysqld max_connections large enough to handle&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; all of your db connections. Set to -1 for no limit.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- maxIdle: Maximum number of idle dB connections to retain in pool.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set to -1 for no limit.&amp;nbsp; See also the DBCP documentation on this&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and the minEvictableIdleTimeMillis configuration parameter.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- maxWait: Maximum time to wait for a dB connection to become available&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in ms, in this example 10 seconds. An Exception is thrown if&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this timeout is exceeded.&amp;nbsp; Set to -1 to wait indefinitely.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- username and password: MySQL dB username and password for dB connections&amp;nbsp; --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- driverClassName: Class name for the old mm.mysql JDBC driver is&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; org.gjt.mm.mysql.Driver - we recommend using Connector/J though.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Class name for the official MySQL Connector/J driver is com.mysql.jdbc.Driver.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- url: The JDBC connection url for connecting to your MySQL dB.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Resource name=&quot;jdbc/JIT&quot; auth=&quot;Container&quot; type=&quot;javax.sql.DataSource&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; username=&quot;root&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; password=&quot;root&quot; maxActive=&quot;-1&quot; maxIdle=&quot;-1&quot; maxWait=&quot;-1&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; driverClassName=&quot;com.mysql.jdbc.Driver&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url=&quot;jdbc:mysql://localhost:3306/sample?autoReconnect=true&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;lt;/Context&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Step 3) Configure your log4j.properties file in your project source directory&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
# Set root category priority to INFO and its only appender to CONSOLE.&lt;br /&gt;
log4j.rootCategory=DEBUG, CONSOLE&lt;br /&gt;
#log4j.rootCategory=INFO, CONSOLE, LOGFILE&lt;br /&gt;
&lt;br /&gt;
# Set the enterprise logger category to FATAL and its only appender to CONSOLE.&lt;br /&gt;
log4j.logger.org.apache.axis.enterprise=FATAL, CONSOLE&lt;br /&gt;
&lt;br /&gt;
# CONSOLE is set to be a ConsoleAppender using a PatternLayout.&lt;br /&gt;
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender&lt;br /&gt;
log4j.appender.CONSOLE.Threshold=DEBUG&lt;br /&gt;
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout&lt;br /&gt;
log4j.appender.CONSOLE.layout.ConversionPattern=[%d{dd MMM yyyy HH:mm:ss}] %l - %m%n&lt;br /&gt;
&lt;br /&gt;
# LOGFILE is set to be a File appender using a PatternLayout.&lt;br /&gt;
log4j.appender.LOGFILE=org.apache.log4j.FileAppender&lt;br /&gt;
log4j.appender.LOGFILE.File=axis.log&lt;br /&gt;
log4j.appender.LOGFILE.Append=true&lt;br /&gt;
log4j.appender.LOGFILE.Threshold=DEBUG&lt;br /&gt;
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout&lt;br /&gt;
log4j.appender.LOGFILE.layout.ConversionPattern=[%d{dd MMM yyyy HH:mm:ss}] %l - %m%n&lt;br /&gt;
&lt;br /&gt;
log4j.logger.org.apache.commons.digester.Digester=info&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------&lt;br /&gt;
Step 4)&amp;nbsp; GetConnPool.java&lt;br /&gt;
Here in the init() i am invoking &amp;amp; closing the connection &lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------------------------&lt;br /&gt;
package com.jit.servlets;&lt;br /&gt;
/**&lt;br /&gt;
&amp;nbsp;* @author Vinay Guntaka&lt;br /&gt;
&amp;nbsp;*/&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import javax.servlet.ServletException;&lt;br /&gt;
import javax.servlet.http.HttpServlet;&lt;br /&gt;
import javax.servlet.http.HttpServletRequest;&lt;br /&gt;
import javax.servlet.http.HttpServletResponse;&lt;br /&gt;
&lt;br /&gt;
import com.jit.connections.ConnectionUtil;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
&amp;nbsp;* Servlet implementation class GetConnPool&lt;br /&gt;
&amp;nbsp;*/&lt;br /&gt;
public class GetConnPool extends HttpServlet {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final long serialVersionUID = 1L;&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;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @see HttpServlet#HttpServlet()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public GetConnPool() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; super();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // TODO Auto-generated constructor stub&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void init() throws ServletException {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // TODO Auto-generated method stub&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; super.init();&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; ConnectionUtil.closeConnection(ConnectionUtil.getConnection());&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // TODO Auto-generated method stub&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // TODO Auto-generated method stub&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------&lt;br /&gt;
Step 5) ConnectionUtil.Java&lt;br /&gt;
&lt;br /&gt;
This is the main program that we are fetching the JNDI Connection Pool Object&lt;br /&gt;
------------------------------------------------&lt;br /&gt;
package com.jit.connections;&lt;br /&gt;
/**&lt;br /&gt;
&amp;nbsp;* @author Vinay Guntaka&lt;br /&gt;
&amp;nbsp;*/&lt;br /&gt;
import java.sql.Connection;&lt;br /&gt;
import java.sql.PreparedStatement;&lt;br /&gt;
import java.sql.ResultSet;&lt;br /&gt;
import java.sql.SQLException;&lt;br /&gt;
import java.sql.Statement;&lt;br /&gt;
&lt;br /&gt;
import javax.naming.Context;&lt;br /&gt;
import javax.naming.InitialContext;&lt;br /&gt;
import javax.sql.DataSource;&lt;br /&gt;
&lt;br /&gt;
import org.apache.log4j.Logger;&lt;br /&gt;
&lt;br /&gt;
public class ConnectionUtil &lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; //Initlizing the Logger&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final Logger logger = Logger.getLogger(ConnectionUtil.class);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static Connection getConnection() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Connection conn = null;&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; Context initCtx = new InitialContext();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Context envCtx = (Context) initCtx.lookup(&quot;java:comp/env&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; DataSource ds = (DataSource) envCtx.lookup(&quot;jdbc/JIT&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; conn = ds.getConnection();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if (conn != 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; logger.info(&quot;Successfully Obtained Connection From ConnectionPool&quot;);&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 conn;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (SQLException se) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; logger.error(se.getMessage());&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (Exception e) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; logger.error(e.getMessage());&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; return conn;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static Connection closeConnection(Connection conn){&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; if(conn != 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; conn.close();&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; conn = 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; logger.info(&quot;Successfully Closed Connection From ConnectionPool&quot;);&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; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (SQLException se) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; logger.error(se.getMessage());&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (Exception e) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; logger.error(e.getMessage());&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; return conn;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
}&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/111381614523269739/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2011/04/configure-jndi-connection-pooling.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/111381614523269739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/111381614523269739'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2011/04/configure-jndi-connection-pooling.html' title='Configure JNDI Connection Pooling:'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-1229259984972608013</id><published>2011-04-18T17:25:00.000-07:00</published><updated>2011-04-18T17:27:57.321-07:00</updated><title type='text'>Retrieving multiple result sets from a stored procedure in a JDBC application</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Hello,&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Retrieving multiple result sets and OUT Parameters by passing IN Parameter from a stored procedure in a JDBC application.&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;i&gt;&lt;u&gt;Connection File: &lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
package com.jit;&lt;br /&gt;
&lt;br /&gt;
import java.sql.CallableStatement;&lt;br /&gt;
import java.sql.Connection;&lt;br /&gt;
import java.sql.DriverManager;&lt;br /&gt;
import java.sql.ResultSet;&lt;br /&gt;
import java.sql.SQLException;&lt;br /&gt;
/**&lt;br /&gt;
&amp;nbsp;* @author Vinay Guntaka&lt;br /&gt;
&amp;nbsp;* Retrieving multiple result sets from a stored procedure in a JDBC application&lt;br /&gt;
&amp;nbsp;* All Connections are Configured in this Class&lt;br /&gt;
&amp;nbsp;*/&lt;br /&gt;
public class ConnectionUtil {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static Connection closeConnection(Connection conn){&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;&amp;nbsp;&amp;nbsp; if(conn != 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; conn.close();&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; conn = 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; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (SQLException se) {&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; System.out.println(se.getMessage());&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (Exception e) {&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; System.out.println(e.getMessage());&lt;br /&gt;
&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; return conn;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static CallableStatement closeCallableStatement(CallableStatement clst){&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;&amp;nbsp;&amp;nbsp; if(clst !=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; clst.close();&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; clst = 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; }&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; }catch (SQLException e) {&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; System.err.println(e.getMessage());&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; }&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; return clst;&lt;br /&gt;
&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; &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static ResultSet closeResultSet(ResultSet resultSet){&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;&amp;nbsp;&amp;nbsp; if(resultSet != 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; resultSet.close();&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; resultSet = 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; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (SQLException se) {&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; System.out.println(se.getMessage());&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (Exception e) {&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; System.out.println(e.getMessage());&lt;br /&gt;
&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; return resultSet;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static Connection getLocalConnection() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Connection conn = null;&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;&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; Class.forName(&quot;com.mysql.jdbc.Driver&quot;).newInstance();&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; String url = &quot;jdbc:mysql://localhost:3306/sample&quot;;&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; conn = DriverManager.getConnection(url, &quot;root&quot;, &quot;root&quot;);&lt;br /&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; if (conn != 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; System.out.println(&quot;Successfully Obtained Connection From ConnectionPool&quot;);&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; }&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; return conn;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (SQLException se) {&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; System.out.println(se.getMessage());&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (Exception e) {&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; System.out.println(e.getMessage());&lt;br /&gt;
&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; return conn;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;u style=&quot;color: red;&quot;&gt;&lt;i&gt;&lt;b&gt;Main Program To Execute Procedure:&lt;/b&gt;&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
package com.jit;&lt;br /&gt;
&lt;br /&gt;
import java.sql.CallableStatement;&lt;br /&gt;
import java.sql.Connection;&lt;br /&gt;
import java.sql.ResultSet;&lt;br /&gt;
import java.sql.Types;&lt;br /&gt;
/**&lt;br /&gt;
&amp;nbsp;* @author Vinay Guntaka&lt;br /&gt;
&amp;nbsp;* We are Fetching the Results from MySQL Procedure by passing&lt;br /&gt;
&amp;nbsp;* one IN Param and fetching One OUT Param with Multiple Result sets.&lt;br /&gt;
&amp;nbsp;*/&lt;br /&gt;
public class CallProcedure {&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; Connection conn =null;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CallableStatement callStmt = null;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ResultSet rs =null;&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;&amp;nbsp; try {&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; conn = ConnectionUtil.getLocalConnection();&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; callStmt = conn.prepareCall(&quot;call proc_getData(?,?)&quot;);&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; //Passing param to Execute First Query&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; callStmt.setInt(1, 22);&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; //Registering the Out Parameter&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; callStmt.registerOutParameter(2,Types.VARCHAR);&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; //Fetching the First RS of OUT Param&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; callStmt.execute();&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; String outParam = callStmt.getString(2);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; // OUT parameter&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; System.out.println(&quot;First Result Set Out Param:-&quot;+outParam);&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; //Fetching the Second Result Set from Procedure&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; rs = callStmt.executeQuery();&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; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&quot;Second Query Result Set&quot;);&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; System.out.println(rs.getString(1));&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; System.out.println(rs.getString(2));&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; System.out.println(rs.getString(3));&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; System.out.println(rs.getString(4));&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; System.out.println(rs.getString(5));&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; }&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; //Checking is there any more result sets&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; if(callStmt.getMoreResults())&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; {&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; System.out.println(&quot;One More Result Set is there&quot;);&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; //Fetching the Thrid Result Set from the Procedure&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; rs = callStmt.executeQuery();&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; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&quot;Thrid Query Result Set&quot;);&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; System.out.println(rs.getString(1));&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; System.out.println(rs.getString(2));&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; System.out.println(rs.getString(3));&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; System.out.println(rs.getString(4));&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; System.out.println(rs.getString(5));&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; }else&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; {&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; System.out.println(&quot;No More Results Sets&quot;);&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; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (Exception e) {&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; System.err.println(e.getMessage());&lt;br /&gt;
&amp;nbsp;&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; &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; //Closing all connections&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; ConnectionUtil.closeConnection(conn);&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; ConnectionUtil.closeCallableStatement(callStmt);&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; ConnectionUtil.closeResultSet(rs);&lt;br /&gt;
&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;div style=&quot;color: red;&quot;&gt;&lt;u&gt;&lt;i&gt;&lt;b&gt;Here is the procedure:&lt;/b&gt;&lt;/i&gt;&lt;/u&gt;&lt;/div&gt;&lt;br /&gt;
DELIMITER $$&lt;br /&gt;
&lt;br /&gt;
DROP PROCEDURE IF EXISTS `sample`.`proc_getData`$$&lt;br /&gt;
&lt;br /&gt;
CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_getData`(in user_id int,out user_name varchar(64))&lt;br /&gt;
BEGIN&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; select user_name from users where id=user_id into user_name ;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from employee;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from users;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; END$$&lt;br /&gt;
&lt;br /&gt;
DELIMITER ;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/1229259984972608013/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2011/04/retrieving-multiple-result-sets-from.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/1229259984972608013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/1229259984972608013'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2011/04/retrieving-multiple-result-sets-from.html' title='Retrieving multiple result sets from a stored procedure in a JDBC application'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-8155812420868154658</id><published>2011-03-31T17:56:00.000-07:00</published><updated>2011-03-31T17:57:14.753-07:00</updated><title type='text'>Installing an SSL Certificate in Tomcat 4.x/5.x/6.x</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
Installing an SSL Certificate in Tomcat 4.x/5.x/6.x&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://help.securepaynet.net/article/5239&quot; target=&quot;-blank&quot;&gt;http://help.securepaynet.net/article/5239&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/8155812420868154658/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2011/03/installing-ssl-certificate-in-tomcat.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/8155812420868154658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/8155812420868154658'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2011/03/installing-ssl-certificate-in-tomcat.html' title='Installing an SSL Certificate in Tomcat 4.x/5.x/6.x'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-2394155408936757692</id><published>2011-03-31T17:53:00.001-07:00</published><updated>2011-03-31T17:53:50.227-07:00</updated><title type='text'>SHA Alogorithm in Java</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, geneva; font-size: 13px;&quot;&gt;import&amp;nbsp;java.security.MessageDigest;&lt;br /&gt;
&lt;br /&gt;
public class Util {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static String getSHA(String text)throws Exception{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; MessageDigest md;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; md =&amp;nbsp;MessageDigest.getInstance(&quot;SHA-1&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; md.update(text.getBytes(&quot;iso-8859-1&quot;), 0, text.length());&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return convertToHex(md.digest());&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static String convertToHex(byte[] data) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StringBuffer buf = new StringBuffer();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; data.length; i++) {&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; int halfbyte = (data[i] &amp;gt;&amp;gt;&amp;gt; 4) &amp;amp; 0x0F;&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; int two_halfs = 0;&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; do {&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; if ((0 &amp;lt;= halfbyte) &amp;amp;&amp;amp; (halfbyte &amp;lt;= 9))&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; buf.append((char) (&#39;0&#39; + halfbyte));&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; else&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; buf.append((char) (&#39;a&#39; + (halfbyte - 10)));&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; halfbyte = data[i] &amp;amp; 0x0F;&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; } while(two_halfs++ &amp;lt; 1);&lt;br /&gt;
&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; return&amp;nbsp;buf.toString();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void main(String[] args) throws Exception {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.println(Util.getSHA(&quot;Vinay Guntaka&quot;));&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;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;
}&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/2394155408936757692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2011/03/sha-alogorithm-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/2394155408936757692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/2394155408936757692'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2011/03/sha-alogorithm-in-java.html' title='SHA Alogorithm in Java'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-4020658235219219456</id><published>2011-03-31T17:51:00.000-07:00</published><updated>2011-03-31T17:51:24.081-07:00</updated><title type='text'>Generating Unique Number in Java</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, geneva; font-size: 13px;&quot;&gt;import java.util.Random;&lt;br /&gt;
&lt;br /&gt;
public class UniqueIDGenerator {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final long serialVersionUID = 1L;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;*&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;* Random-number generator.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static transient Random r = new Random();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; // use constanst to prevent warnings about magic numbers:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final long HEX_3FFFFFFFFFFFFFFF = 0x3FFFFFFFFFFFFFFFL;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final long HEX_8000000000000000 = 0x8000000000000000L;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final long HEX_FFFFFFFFFFFF0FFF = 0xFFFFFFFFFFFF0FFFL;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final long HEX_4000 = 0x4000;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final long HEX_FFFFFFFF00000000 = 0xFFFFFFFF00000000L;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final long HEX_FFFFFFFF = 0xFFFFFFFFL;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final long HEX_FFFF0000 = 0xFFFF0000L;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final long HEX_0000000000000000FFFF = 0x0000000000000000FFFFL;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final long HEX_FFFF000000000000 = 0xFFFF000000000000L;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final long HEX_FFFF = 0xFFFF;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final long HEX_FFFFFFFFFFFF = 0xFFFFFFFFFFFFL;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final int DEC_4 = 4;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final int DEC_8 = 8;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final int DEC_12 = 12;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final int DEC_16 = 16;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final int DEC_32 = 32;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final int DEC_48 = 48;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;*&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;* @return a string with a universally unique id of format:&lt;br /&gt;
&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; xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx .&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static String generateUUID() {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // calculate lsb and msb&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; long leastSigBits =&amp;nbsp;r.nextLong();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; long mostSigBits =&amp;nbsp;r.nextLong();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; leastSigBits &amp;amp;= HEX_3FFFFFFFFFFFFFFF;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; leastSigBits |= HEX_8000000000000000; // set top two bits to variant 2&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mostSigBits &amp;amp;= HEX_FFFFFFFFFFFF0FFF;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mostSigBits |= HEX_4000; // Version 4;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // turn leastSigBits and mostSigBits into string of format:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; String id =&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; padHex(((mostSigBits &amp;amp; HEX_FFFFFFFF00000000) &amp;gt;&amp;gt; DEC_32) &amp;amp; HEX_FFFFFFFF,&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; DEC_8)&lt;br /&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; + &quot;-&quot;&lt;br /&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; + padHex(((mostSigBits &amp;amp; HEX_FFFF0000) &amp;gt;&amp;gt; DEC_16), DEC_4)&lt;br /&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; + &quot;-&quot;&lt;br /&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; + padHex((mostSigBits &amp;amp; HEX_0000000000000000FFFF), DEC_4)&lt;br /&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; + &quot;-&quot;&lt;br /&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; + padHex(&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; (((leastSigBits &amp;amp; HEX_FFFF000000000000) &amp;gt;&amp;gt; DEC_48) &amp;amp; HEX_FFFF),&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; DEC_4)&lt;br /&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; + &quot;-&quot;&lt;br /&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; + padHex(leastSigBits &amp;amp; HEX_FFFFFFFFFFFF, DEC_12);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return id;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;*&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;* Returns a hex String from l, padded to n spaces.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;*&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;* @param l&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;*&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;* @param n&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;*&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;* @return String&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static String padHex(long l, int n) {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; String s =&amp;nbsp;Long.toHexString(l);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; while (s.length() &amp;lt; n) {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; s = &quot;0&quot; + s;&lt;br /&gt;
&lt;br /&gt;
&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; return s;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&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;System.out.println(generateUUID());&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, geneva; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, geneva; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/4020658235219219456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2011/03/generating-unique-number-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/4020658235219219456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/4020658235219219456'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2011/03/generating-unique-number-in-java.html' title='Generating Unique Number in Java'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-1929880348978848950</id><published>2010-11-28T04:44:00.000-08:00</published><updated>2010-11-28T04:44:47.000-08:00</updated><title type='text'>Improving the Performance of a JDBC Program</title><content type='html'>A java program that uses JDBC to connect to a database and retrieve the data from the database may take some time to perform these tasks. To know how much time has been taken by a JDBC program. we can take the help of currentTimeMillis() method of System class. This method gives the current&amp;nbsp; time in milliseconds since January 1st 1970.&lt;br /&gt;
&lt;br /&gt;
By Reducing the execution time of a JDBC Program, we can improve its performance. The execution time of a JDBC program depends on the Following factors:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&lt;b&gt;The driver used to connect to the database will influence the execution time. Each driver will exhibit different performance and hence, selecting a good driver that gives optimum performance will improve the performance of a JDBC program.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;setFetchSize() method of statement interface is useful to tell the driver how many rows at a time to be fetched from the database. By increasing the number of rows to be retrieved at a time, it is possible to improve the performance of a JDBC program.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Sometimes PreparedStatment inteface can be used in place of Statement interface for improving the performance.&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt; &lt;br /&gt;
&lt;b&gt;Affect&amp;nbsp; of PerparedStatement:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Using the PreparedStatement in place of Statement Interface will improve the performance of a JDBC program.&lt;br /&gt;
&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
When a SQL Statement is sent to database, the following tasks are performed:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;The SQL Statement&#39;s Syntax should be verified to know whether it is correct or not. The SQL statement is divided into small pieces called &quot;tokens&quot;. These tokens are also verified to know whether they are in SQL format or not.&lt;/li&gt;
&lt;li&gt;Then another verification is done to know whether the table or view mentioned in the statement exists or not.&lt;/li&gt;
&lt;/ul&gt;The above two statements are called &quot;parsing&quot; and takes some time. When the SQL Statement is executed, Statement interface does parsing every time the statement is executed.&lt;br /&gt;
&lt;br /&gt;
On the Other hand if we use preparedStatement, it does parsing only once.&lt;br /&gt;
This saves time and hence PreparedStatement offers better Performance.&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;br /&gt;
Vinay Guntaka</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/1929880348978848950/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2010/11/improving-performance-of-jdbc-program.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/1929880348978848950'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/1929880348978848950'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2010/11/improving-performance-of-jdbc-program.html' title='Improving the Performance of a JDBC Program'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-6057503179101999197</id><published>2010-11-28T04:24:00.000-08:00</published><updated>2010-11-28T04:49:35.121-08:00</updated><title type='text'>Java Database Conntectivity</title><content type='html'>Stages in JDBC Porgram:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Registering the Driver &lt;/li&gt;
&lt;li&gt;Connecting to the Database&lt;/li&gt;
&lt;li&gt;Preparing SQL Statements in java&lt;/li&gt;
&lt;li&gt;Executing the SQL Statements on the Database&lt;/li&gt;
&lt;li&gt;Retrieving the Results.&lt;/li&gt;
&lt;li&gt;Closing the Connections.&lt;/li&gt;
&lt;/ol&gt;&lt;u&gt;&lt;b style=&quot;color: #38761d;&quot;&gt;A List of JDBC Drivers&lt;/b&gt;:&amp;nbsp;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
If you need to access a database with Java, you need a driver. This is a list of the drivers available, what database they can access, who makes it, and how to contact them.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;IBM DB2&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:db2://&amp;lt;HOST&amp;gt;:&amp;lt;PORT&amp;gt;/&amp;lt;DB&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; com.ibm.db2.jdbc.app.DB2Driver&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;JDBC-ODBC Bridge&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:odbc:&amp;lt;DB&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sun.jdbc.odbc.JdbcOdbcDriver &lt;br /&gt;
&lt;b&gt;Microsoft SQL Server&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:weblogic:mssqlserver4:&amp;lt;&lt;wbr&gt;&lt;/wbr&gt;DB&amp;gt;@&amp;lt;HOST&amp;gt;:&amp;lt;PORT&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; weblogic.jdbc.mssqlserver4.&lt;wbr&gt;&lt;/wbr&gt;Driver &lt;br /&gt;
&lt;b&gt;Oracle Thin&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:oracle:thin:@&amp;lt;HOST&amp;gt;:&amp;lt;&lt;wbr&gt;&lt;/wbr&gt;PORT&amp;gt;:&amp;lt;SID&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oracle.jdbc.driver.&lt;wbr&gt;&lt;/wbr&gt;OracleDriver &lt;br /&gt;
&lt;b&gt;PointBase Embedded Server&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:pointbase://embedded[:&amp;lt;&lt;wbr&gt;&lt;/wbr&gt;PORT&amp;gt;]/&amp;lt;DB&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; com.pointbase.jdbc.&lt;wbr&gt;&lt;/wbr&gt;jdbcUniversalDriver &lt;br /&gt;
&lt;b&gt;Cloudscape&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:cloudscape:&amp;lt;DB&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COM.cloudscape.core.JDBCDriver &lt;br /&gt;
&lt;b&gt;Cloudscape RMI&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:rmi://&amp;lt;HOST&amp;gt;:&amp;lt;PORT&amp;gt;/jdbc:&lt;wbr&gt;&lt;/wbr&gt;cloudscape:&amp;lt;DB&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RmiJdbc.RJDriver &lt;br /&gt;
&lt;b&gt;Firebird (JCA/JDBC Driver)&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:firebirdsql:[//&amp;lt;HOST&amp;gt;[:&amp;lt;&lt;wbr&gt;&lt;/wbr&gt;PORT&amp;gt;]/]&amp;lt;DB&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; org.firebirdsql.jdbc.FBDriver &lt;br /&gt;
&lt;b&gt;IDS Server&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:ids://&amp;lt;HOST&amp;gt;:&amp;lt;PORT&amp;gt;/conn?&lt;wbr&gt;&lt;/wbr&gt;dsn=&#39;&amp;lt;ODBC_DSN_NAME&amp;gt;&#39;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ids.sql.IDSDriver &lt;br /&gt;
&lt;b&gt;Informix Dynamic Server&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:informix-sqli://&amp;lt;HOST&amp;gt;:&amp;lt;&lt;wbr&gt;&lt;/wbr&gt;PORT&amp;gt;/&amp;lt;DB&amp;gt;:INFORMIXSERVER=&amp;lt;&lt;wbr&gt;&lt;/wbr&gt;SERVER_NAME&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; com.informix.jdbc.IfxDriver &lt;br /&gt;
&lt;b&gt;InstantDB (v3.13 and earlier)&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:idb:&amp;lt;DB&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc.idbDriver &lt;br /&gt;
&lt;b&gt;InstantDB (v3.14 and later)&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:idb:&amp;lt;DB&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; org.enhydra.instantdb.jdbc.&lt;wbr&gt;&lt;/wbr&gt;idbDriver &lt;br /&gt;
&lt;b&gt;Interbase (InterClient Driver)&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:interbase://&amp;lt;HOST&amp;gt;/&amp;lt;DB&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; interbase.interclient.Driver &lt;br /&gt;
&lt;b&gt;Hypersonic SQL (v1.2 and earlier)&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:HypersonicSQL:&amp;lt;DB&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hSql.hDriver &lt;br /&gt;
&lt;b&gt;Hypersonic SQL (v1.3 and later)&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:HypersonicSQL:&amp;lt;DB&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; org.hsql.jdbcDriver &lt;br /&gt;
&lt;b&gt;Microsoft SQL Server (JTurbo Driver)&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:JTurbo://&amp;lt;HOST&amp;gt;:&amp;lt;PORT&amp;gt;/&amp;lt;&lt;wbr&gt;&lt;/wbr&gt;DB&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; com.ashna.jturbo.driver.Driver &lt;br /&gt;
&lt;b&gt;Microsoft SQL Server (Sprinta Driver)&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:inetdae:&amp;lt;HOST&amp;gt;:&amp;lt;PORT&amp;gt;?&lt;wbr&gt;&lt;/wbr&gt;database=&amp;lt;DB&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; com.inet.tds.TdsDriver &lt;br /&gt;
&lt;b&gt;Microsoft SQL Server 2000 (Microsoft Driver)&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:microsoft:sqlserver://&amp;lt;&lt;wbr&gt;&lt;/wbr&gt;HOST&amp;gt;:&amp;lt;PORT&amp;gt;[;DatabaseName=&amp;lt;&lt;wbr&gt;&lt;/wbr&gt;DB&amp;gt;]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; com.microsoft.sqlserver.jdbc.&lt;wbr&gt;&lt;/wbr&gt;SQLServerDriver &lt;br /&gt;
&lt;b&gt;MySQL (MM.MySQL Driver)&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:mysql://&amp;lt;HOST&amp;gt;:&amp;lt;PORT&amp;gt;/&amp;lt;&lt;wbr&gt;&lt;/wbr&gt;DB&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; com.mysql.jdbc.Driver&lt;br /&gt;
&lt;b&gt;Oracle OCI 8i&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:oracle:oci8:@&amp;lt;SID&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oracle.jdbc.driver.&lt;wbr&gt;&lt;/wbr&gt;OracleDriver &lt;br /&gt;
&lt;b&gt;Oracle OCI 9i&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:oracle:oci:@&amp;lt;SID&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oracle.jdbc.driver.&lt;wbr&gt;&lt;/wbr&gt;OracleDriver &lt;br /&gt;
&lt;b&gt;PostgreSQL (v6.5 and earlier)&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:postgresql://&amp;lt;HOST&amp;gt;:&amp;lt;&lt;wbr&gt;&lt;/wbr&gt;PORT&amp;gt;/&amp;lt;DB&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; postgresql.Driver &lt;br /&gt;
&lt;b&gt;PostgreSQL (v7.0 and later)&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:postgresql://&amp;lt;HOST&amp;gt;:&amp;lt;&lt;wbr&gt;&lt;/wbr&gt;PORT&amp;gt;/&amp;lt;DB&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; org.postgresql.Driver &lt;br /&gt;
&lt;b&gt;Sybase (jConnect 4.2 and earlier)&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:sybase:Tds:&amp;lt;HOST&amp;gt;:&amp;lt;PORT&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; com.sybase.jdbc.SybDriver &lt;br /&gt;
&lt;b&gt;Sybase (jConnect 5.2)&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbc:sybase:Tds:&amp;lt;HOST&amp;gt;:&amp;lt;PORT&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; com.sybase.jdbc2.jdbc.&lt;wbr&gt;&lt;/wbr&gt;SybDriver &lt;br /&gt;
&lt;br /&gt;
----------------------------------------------&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
Here i am writing a sample code for JDBC.&lt;br /&gt;
&lt;br /&gt;
try &lt;br /&gt;
&lt;pre&gt;&lt;code&gt;{
  &lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Class.forName(&quot;Driver name&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;  // DriverManager.registerDriver(new Drivername()); &lt;/span&gt;
   &lt;span style=&quot;font-size: small;&quot;&gt;Connection con = DriverManager.getConnenction(&quot;&lt;/span&gt;&lt;wbr&gt;&lt;/wbr&gt;&lt;span style=&quot;font-size: small;&quot;&gt;jdbcurl&quot;,&quot;username&quot;,&quot;password&quot;&lt;/span&gt;&lt;wbr&gt;&lt;/wbr&gt;&lt;span style=&quot;font-size: small;&quot;&gt;);&lt;/span&gt;
   &lt;span style=&quot;font-size: small;&quot;&gt;Statement st = con.createStatement();&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;  ResultSet rs= st.executeQuery(&quot;select * from Tablename&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; While(){}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;  rs.close();&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;  st.close(); &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;  conn.close(); &lt;/span&gt;&lt;/span&gt;
}
catch(Exception e)
{
}&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&amp;nbsp;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;Thanks&amp;nbsp;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;Vinay Guntaka&lt;/code&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/6057503179101999197/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2010/11/java-database-conntectivity.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/6057503179101999197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/6057503179101999197'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2010/11/java-database-conntectivity.html' title='Java Database Conntectivity'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-2903179121611160618</id><published>2010-11-27T21:43:00.000-08:00</published><updated>2010-11-27T21:48:04.121-08:00</updated><title type='text'>A Brief History of Java and JDBC</title><content type='html'>&lt;h1 id=&quot;watch-headline-title&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt;&lt;span class=&quot;&quot; dir=&quot;ltr&quot; id=&quot;eow-title&quot; title=&quot;A Brief History of Java and JDBC&quot;&gt;&lt;/span&gt;&lt;/i&gt;&lt;/h1&gt;&lt;object height=&quot;300&quot; width=&quot;350&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/WAy9mgEYb6o?fs=1&amp;amp;hl=en_US&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/WAy9mgEYb6o?fs=1&amp;amp;hl=en_US&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;350&quot; height=&quot;300&quot;&gt;&lt;/embed&gt;&lt;/object&gt;</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/2903179121611160618/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2010/11/brief-history-of-java-and-jdbc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/2903179121611160618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/2903179121611160618'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2010/11/brief-history-of-java-and-jdbc.html' title='A Brief History of Java and JDBC'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-5299936464019501986</id><published>2010-11-17T09:52:00.000-08:00</published><updated>2010-11-17T09:53:03.790-08:00</updated><title type='text'>Drools 5.0 plugin Installation to Eclipse3.5 Galileo</title><content type='html'>&lt;div style=&quot;color: red;&quot;&gt;&lt;i&gt;&lt;b&gt;Drools 5.0 Installation:&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;------------------------&lt;br /&gt;
Drools is a  business rule management system (BRMS) with a forward chaining inference  based rules engine, more correctly known as a production rule system,  using an enhanced implementation of the Rete algorithm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Drools 5.0 plugin Installation to Eclipse3.5 Galileo&lt;br /&gt;
&lt;br /&gt;
Step 1:&lt;br /&gt;
&lt;br /&gt;
Pls download the eclipse 3.5 Galileo (190mb) from the following link&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/galileo/SR2/eclipse-jee-galileo-SR2-win32.zip&quot; rel=&quot;nofollow&quot;&gt;http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/galileo/SR2/eclipse-jee-galileo-SR2-win32.zip&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step 2:&lt;br /&gt;
&lt;br /&gt;
Download the Drools 5.0 workbench from the following link:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://download.jboss.org/drools/release/5.0.1.26597.FINAL/drools-5.0-eclipse-all.zip&quot; rel=&quot;nofollow&quot;&gt;http://download.jboss.org/drools/release/5.0.1.26597.FINAL/drools-5.0-eclipse-all.zip&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Step 3:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Extract both files to Eclipse-jee-galileo-SR2-win32 and drools-5.0-eclipse-all&lt;br /&gt;
&lt;br /&gt;
copy the FEATURES and PLUG-INS of Drools 5.0 and paste it in the respective Eclipse-jee-galileo-SR2-win32&lt;br /&gt;
&lt;br /&gt;
Step 4:&lt;br /&gt;
&lt;br /&gt;
Just Restart the Eclipse and go to Windows-&amp;gt;Prefrences-&amp;gt;Drools-&amp;gt;Installed Drools Runtime&lt;br /&gt;
give the path of the extracted files of the Drools Dir &lt;br /&gt;
set ok and plz once again restart the eclipse so that the Drools Perspective will be installed to that &lt;br /&gt;
eclipse &lt;br /&gt;
&lt;br /&gt;
Step 5:&lt;br /&gt;
&lt;br /&gt;
Simply You can select the New Project Drools and execute the Drools&lt;br /&gt;
and have a great exp with Drools&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;br /&gt;
GVK</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/5299936464019501986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2010/11/drools-50-plugin-installation-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/5299936464019501986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/5299936464019501986'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2010/11/drools-50-plugin-installation-to.html' title='Drools 5.0 plugin Installation to Eclipse3.5 Galileo'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-6133472401553243313</id><published>2010-11-17T09:46:00.000-08:00</published><updated>2010-11-17T09:46:15.404-08:00</updated><title type='text'>Generic XML Parsing Method</title><content type='html'>&lt;div id=&quot;logphoto&quot; style=&quot;float: left; padding-bottom: 10px; padding-left: 0px; padding-right: 10px;&quot;&gt;  &lt;div id=&quot;personphoto&quot;&gt; &lt;div id=&quot;myphoto&quot;&gt;&lt;a href=&quot;http://www.siliconindia.com/profiles/M43G1lZ9/Vinay_Guntaka_Java_Programmer.html&quot;&gt;&lt;img alt=&quot;Vinay  Guntaka&quot; border=&quot;0&quot; class=&quot;photonewcommunity&quot; height=&quot;148&quot; src=&quot;http://www.siliconindia.com/images1/userphotos/tb_1F459X308.jpg&quot; title=&quot;Vinay  Guntaka&quot; width=&quot;128&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div id=&quot;mydis&quot;&gt;&lt;a href=&quot;http://www.siliconindia.com/profiles/M43G1lZ9/Vinay_Guntaka_Java_Programmer.html&quot;&gt;Vinay  Guntaka &lt;br /&gt;
&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;vvvl12liteAsh&quot; id=&quot;mydis2&quot;&gt;Java Programmer&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
import java.io.StringReader;&lt;br /&gt;
import java.util.ArrayList;&lt;br /&gt;
import java.util.HashMap;&lt;br /&gt;
import java.util.List;&lt;br /&gt;
import java.util.Map;&lt;br /&gt;
&lt;br /&gt;
import javax.xml.parsers.DocumentBuilder;&lt;br /&gt;
import javax.xml.parsers.DocumentBuilderFactory;&lt;br /&gt;
&lt;br /&gt;
import org.w3c.dom.Document;&lt;br /&gt;
import org.w3c.dom.Element;&lt;br /&gt;
import org.w3c.dom.Node;&lt;br /&gt;
import org.w3c.dom.NodeList;&lt;br /&gt;
import org.xml.sax.InputSource;&lt;br /&gt;
import org.xml.sax.SAXException;&lt;br /&gt;
import org.xml.sax.SAXParseException;&lt;br /&gt;
&lt;br /&gt;
public class ParseXML {&lt;br /&gt;
public Map&amp;lt;List&amp;lt;String&amp;gt;,Integer&amp;gt; parseXMLData(String xmlData,String rootTag,List&amp;lt;String&amp;gt; childTags)&lt;br /&gt;
{&lt;br /&gt;
Map&amp;lt;List&amp;lt;String&amp;gt;, Integer &amp;gt; xmlMap = new HashMap&amp;lt;List&amp;lt;String&amp;gt;,Integer&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
try {&lt;br /&gt;
&lt;br /&gt;
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();&lt;br /&gt;
DocumentBuilder builder = dbf.newDocumentBuilder();&lt;br /&gt;
Document document = builder.parse(new InputSource(new StringReader(xmlData)));&lt;br /&gt;
NodeList nodeLst = document.getElementsByTagName(rootTag);&lt;br /&gt;
for (int s = 0; s &amp;lt; nodeLst.getLength(); s++) {&lt;br /&gt;
List&amp;lt;String&amp;gt; subItems = new ArrayList&amp;lt;String&amp;gt;();&lt;br /&gt;
for (int count = 0; count &amp;lt; childTags.size(); count++) {&lt;br /&gt;
Node fstNode = nodeLst.item(s);&lt;br /&gt;
if (fstNode.getNodeType() == Node.ELEMENT_NODE) {&lt;br /&gt;
Element fstElmnt = (Element) fstNode;&lt;br /&gt;
NodeList fstNmElmntLst = fstElmnt.getElementsByTagName(childTags.get(count));&lt;br /&gt;
Element fstNmElmnt = (Element) fstNmElmntLst.item(0);&lt;br /&gt;
NodeList fstNm = fstNmElmnt.getChildNodes();&lt;br /&gt;
subItems.add(((Node) fstNm.item(0)).getNodeValue());&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
xmlMap.put(subItems, s);&lt;br /&gt;
}&lt;br /&gt;
}   catch (SAXParseException err) {&lt;br /&gt;
System.out.println(&quot;** Parsing error&quot; + &quot;, line &quot; + err.getLineNumber() + &quot;, uri &quot; + err.getSystemId());&lt;br /&gt;
System.out.println(&quot; &quot; + err.getMessage());&lt;br /&gt;
&lt;br /&gt;
} catch (SAXException e) {&lt;br /&gt;
Exception x = e.getException();&lt;br /&gt;
((x == null) ? e : x).printStackTrace();&lt;br /&gt;
&lt;br /&gt;
} catch (Throwable t) {&lt;br /&gt;
t.printStackTrace();&lt;br /&gt;
}&lt;br /&gt;
return xmlMap;&lt;br /&gt;
}&lt;br /&gt;
public static void main(String[] args) {&lt;br /&gt;
ParseXML p = new ParseXML();&lt;br /&gt;
String xmlData =  &quot;&amp;lt;data&amp;gt;&amp;lt;row&amp;gt;&amp;lt;Attribute_Name&amp;gt;java&amp;lt;/Attribute_Name&amp;gt;&amp;lt;VALUE&amp;gt;5656&amp;lt;/VALUE&amp;gt;&amp;lt;Child_Name&amp;gt;kids&amp;lt;/Child_Name&amp;gt;&amp;lt;/row&amp;gt;&quot;+&lt;br /&gt;
&quot;&amp;lt;/data&amp;gt;&quot;;&lt;br /&gt;
String rootTag = &quot;row&quot;;&lt;br /&gt;
List&amp;lt;String&amp;gt; tagList = new ArrayList&amp;lt;String&amp;gt;();&lt;br /&gt;
tagList.add(&quot;Attribute_Name&quot;);&lt;br /&gt;
tagList.add(&quot;VALUE&quot;);&lt;br /&gt;
tagList.add(&quot;Child_Name&quot;);&lt;br /&gt;
Map&amp;lt;List&amp;lt;String&amp;gt;,Integer&amp;gt; myData = p.parseXMLData(xmlData, rootTag, tagList);&lt;br /&gt;
System.out.println(myData);&lt;br /&gt;
}&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/6133472401553243313/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2010/11/generic-xml-parsing-method.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/6133472401553243313'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/6133472401553243313'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2010/11/generic-xml-parsing-method.html' title='Generic XML Parsing Method'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-7764940530376143933</id><published>2010-11-02T10:54:00.000-07:00</published><updated>2010-11-02T10:54:52.472-07:00</updated><title type='text'>Android Dynamic List with buttons and event listener of each button</title><content type='html'>&lt;b style=&quot;color: red;&quot;&gt;Creating a custom list view – a custom layout, a  custom row layout and how we bind the custom data holder to these  layouts.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
So, here we extends simple &lt;b&gt;Activity &lt;/b&gt;not &lt;b&gt;ListActivity.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Here i am giving the entire work of my Dynamic List with &lt;b&gt;Button, &lt;/b&gt;where we get the event listener of each button from &lt;b&gt;android:onClick=&quot;myClickHandler&quot; &lt;/b&gt;in one of the layout file. From this event we can get the selected value and pass to other intents.&lt;br /&gt;
&lt;br /&gt;
Here is the program....if you find any concerns or updates let me know will update accordingly....&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;package com.jit;&lt;br /&gt;
/*&lt;br /&gt;
&amp;nbsp;* Vinay Guntaka&lt;br /&gt;
&amp;nbsp;* Desc: Dynamic List with buttons and event listener of each buttons.&lt;br /&gt;
&amp;nbsp;*/&lt;br /&gt;
import java.util.ArrayList;&lt;br /&gt;
import java.util.HashMap;&lt;br /&gt;
import java.util.List;&lt;br /&gt;
&lt;br /&gt;
import android.app.Activity;&lt;br /&gt;
import android.graphics.Color;&lt;br /&gt;
import android.os.Bundle;&lt;br /&gt;
import android.view.View;&lt;br /&gt;
import android.widget.Button;&lt;br /&gt;
import android.widget.LinearLayout;&lt;br /&gt;
import android.widget.ListView;&lt;br /&gt;
import android.widget.SimpleAdapter;&lt;br /&gt;
import android.widget.Toast;&lt;br /&gt;
&lt;br /&gt;
public class ListViewButtons extends Activity {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setContentView(R.layout.main);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ListView listView = (ListView)findViewById(&lt;a href=&quot;http://r.id/&quot; target=&quot;_blank&quot;&gt;R.id&lt;/a&gt;.btnOptionList);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; List&amp;lt;HashMap&amp;lt;String, String&amp;gt;&amp;gt; myOptList = getOptionList(EnumTypes.OPTION);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; SimpleAdapter optionList = new SimpleAdapter(getBaseContext(),myOptList,R.layout.btnstablerows,&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; 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;&amp;nbsp;&amp;nbsp; &quot;optnCard&quot;&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; },new int[]{&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;a href=&quot;http://r.id/&quot; target=&quot;_blank&quot;&gt;R.id&lt;/a&gt;.btnAddOptn&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; listView.setAdapter(optionList);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; listView.setTextFilterEnabled(true);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /*&amp;nbsp;&amp;nbsp;&amp;nbsp; myClickHandler() is defined in btnstablerows.xml for &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&amp;nbsp; onClick event android:onClick=&quot;myClickHandler&quot;.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void myClickHandler(View v)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; LinearLayout vwParentRow = (LinearLayout)v.getParent();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /*&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Based on the row of each field the values of &amp;lt;td&amp;gt; can be &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * get based on the field type and field location&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * just replace with 0,1,2,.... of getChildAt();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * get the 2nd child of our ParentRow (remember in java that arrays start with zero,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;* so our 2nd child has an index of 1)&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Button btnChild = (Button)vwParentRow.getChildAt(0);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Toast.makeText(getBaseContext(), btnChild.getText(), Toast.LENGTH_LONG).show();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; int c = Color.CYAN;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; vwParentRow.setBackgroundColor(c);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; vwParentRow.refreshDrawableState();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Toast.makeText(getBaseContext(), &quot;Hey event fired&quot;, Toast.LENGTH_LONG).show();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private ArrayList&amp;lt;HashMap&amp;lt;String, String&amp;gt;&amp;gt; getOptionList(EnumTypes type){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ArrayList&amp;lt;HashMap&amp;lt;String, String&amp;gt;&amp;gt; mylist = new ArrayList&amp;lt;HashMap&amp;lt;String, String&amp;gt;&amp;gt;();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; HashMap&amp;lt;String, String&amp;gt; map = new HashMap&amp;lt;String, String&amp;gt;();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; switch (type) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; case OPTION:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; map.put(&quot;optnCard&quot;, &quot;JAVA&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mylist.add(map);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; map = new HashMap&amp;lt;String, String&amp;gt;();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; map.put(&quot;optnCard&quot;, &quot;Eclipse Galileo&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mylist.add(map);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; map = new HashMap&amp;lt;String, String&amp;gt;();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; map.put(&quot;optnCard&quot;, &quot;Android 2.2&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mylist.add(map);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; map = new HashMap&amp;lt;String, String&amp;gt;();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; map.put(&quot;optnCard&quot;, &quot;Simulator Android&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mylist.add(map);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; default:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; break;&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; return mylist;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public enum EnumTypes{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; OPTION&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;-----------------&lt;/div&gt;&lt;div&gt;main.xml&lt;/div&gt;&lt;div&gt;----------&lt;/div&gt;&lt;div&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;
&amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; android:orientation=&quot;vertical&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; android:layout_width=&quot;fill_parent&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; android:layout_height=&quot;fill_parent&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&lt;br /&gt;
&amp;lt;ListView android:id=&quot;@+id/btnOptionList&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; android:layout_width=&quot;200px&quot; android:layout_height=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; android:drawSelectorOnTop=&quot;false&quot; android:paddingLeft=&quot;35px&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; android:paddingTop=&quot;10px&quot; android:clickable=&quot;true&quot; android:scrollbars=&quot;none&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ListView&amp;gt;&lt;br /&gt;
&amp;lt;/LinearLayout&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;----------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;btnstablerows.xml&lt;/div&gt;&lt;div&gt;--------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- row.xml --&amp;gt;&lt;br /&gt;
&amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; android:paddingTop=&quot;4dip&quot; android:paddingBottom=&quot;6dip&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Button android:id=&quot;@+id/btnAddOptn&quot; android:layout_width=&quot;fill_parent&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; android:layout_height=&quot;wrap_content&quot; android:clickable=&quot;true&quot; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/&amp;gt;&lt;br /&gt;
&amp;lt;/LinearLayout&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;-----------------------&lt;br /&gt;
&lt;b style=&quot;color: #38761d;&quot;&gt;Hey.., I am a newbie to Android World&lt;/b&gt;&lt;br /&gt;
So please have a look at my Program and let me know if any thing missing &lt;br /&gt;
&lt;br /&gt;
Thanks</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/7764940530376143933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2010/11/android-dynamic-list-with-buttons-and.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/7764940530376143933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/7764940530376143933'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2010/11/android-dynamic-list-with-buttons-and.html' title='Android Dynamic List with buttons and event listener of each button'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-4562760174166314641</id><published>2010-11-02T10:34:00.000-07:00</published><updated>2010-11-02T10:34:11.319-07:00</updated><title type='text'>Android Environment setup with Eclispe3.5 Galileo</title><content type='html'>&lt;div style=&quot;color: red;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;&lt;strong&gt;Android &amp;nbsp;Plugin Installation Procedure to Eclispe3.5 Galileo&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: red;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Minimum requirements for developing a sample android application are as follows:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black;&quot;&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt; Java 1.6 Eclipse Galileo&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt; Android SDK&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;You can download the Android SDK from the following link with respective OS :&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&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;a href=&quot;http://developer.android.com/sdk/index.html&quot;&gt;http://developer.android.com/sdk/index.html&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Install the ADT Plug-in for Eclipse&lt;/span&gt;:&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;color: black;&quot;&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; &lt;span style=&quot;font-size: small;&quot;&gt;If  you are developing in Eclipse, set up a remote update site at  &lt;a href=&quot;https://dl-ssl.google.com/android/eclipse/&quot;&gt;https://dl-ssl.google.com/android/eclipse/&lt;/a&gt;.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Install the Android  Development Tools (ADT) Plugin, restart Eclipse, and set the &quot;Android&quot;  preferences in Eclipse to point to the SDK install location. For  detailed instructions, see ADT Plugin for Eclipse.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Procedure for downloading plugins:&lt;/span&gt;&lt;/b&gt; &lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Start Eclipse, then select Help &amp;gt; Install New Software.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;In the Available Software dialog, click Add....&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;In the Add Site dialog that appears,  enter a name for the remote site (for example, &quot;Android Plugin&quot;) in the  &quot;Name&quot; field.In the &quot;Location&quot; field, enter this  URL:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&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; &lt;a href=&quot;https://dl-ssl.google.com/android/eclipse/%20&quot;&gt;https://dl-ssl.google.com/android/eclipse/&amp;nbsp;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Note:&lt;/b&gt; If you have trouble  acquiring the plugin, you can try using &quot;http&quot; in the URL, instead of  &quot;https&quot; (https is preferred for security reasons).&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Click OK.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Back in the Available  Software view, you should now see &quot;Developer Tools&quot; added to the list.  Select the checkbox next to Developer Tools, which will automatically  select the nested tools Android DDMS and Android Development Tools.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Click Next.In the resulting Install  Details dialog, the Android DDMS and Android Development Tools features  are listed.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Click Next to read and accept the license agreement and  install any dependencies, then click Finish.Restart Eclipse.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;So you are ready to develop the Android Programs&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: small;&quot;&gt;At first you have to set the Android RunTime :-&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Goto Eclipse Window tab-&amp;gt; Preferences -&amp;gt;set the Android SDK location (downloaded of the Android sdk system path).&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Android SDK and AVD Manger(Android Emulator):&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;After  Successfull installation of Android plugins you can see a icon with a  down arrow (i.e, Android SDK and AVD console)on click it opens the list  of existing AVD (Android Virtual Device ) if not you can create a new  AVD by selecting the New button.There you can give the AVD name and  selecting the target as android version (1.5,2.1,2.2..,)In Hardware  there are certain options that supports the Android Emulator.After  giving all details mentioned you can start the Device by pressing Launch  button to open the Android Emulator.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;There is a DDMS(Dalvik Debug Monitoring Service) prespetive to open the LogCat of Android,FileExplorer view etc.,&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;The above process is to configure the Android Environment.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Thanks&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: red;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/4562760174166314641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2010/11/android-environment-setup-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/4562760174166314641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/4562760174166314641'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2010/11/android-environment-setup-with.html' title='Android Environment setup with Eclispe3.5 Galileo'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-166816911705825044</id><published>2010-10-28T11:14:00.000-07:00</published><updated>2010-10-28T11:14:19.480-07:00</updated><title type='text'>The Evolution of Java</title><content type='html'>&lt;div style=&quot;color: red;&quot;&gt;&lt;i&gt;&lt;b&gt;&amp;nbsp;The Evolution of JAVA&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
&lt;b style=&quot;color: #38761d;&quot;&gt;JDK 1.0&lt;/b&gt; Intial Release&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #38761d;&quot;&gt;JDK 1.1&lt;/b&gt;&amp;nbsp; &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;an extensive retooling of the AWT event model&lt;/li&gt;
&lt;li&gt;Inner classes added to the language &lt;/li&gt;
&lt;li&gt;JavaBeans&lt;/li&gt;
&lt;li&gt;JDBC &lt;/li&gt;
&lt;li&gt;RMI&lt;/li&gt;
&lt;/ul&gt;&lt;b style=&quot;color: #38761d;&quot;&gt;J2SE 1.2&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;strictfp keyword&lt;/li&gt;
&lt;li&gt;reflection which supports introspection only, no modification at runtime possible&lt;/li&gt;
&lt;li&gt;The swing graphical API was integrated into the core classes&lt;/li&gt;
&lt;li&gt;Sun&#39;s JVM was equipped with a JIT Compiler for the first time&lt;/li&gt;
&lt;li&gt;Java aplug-in &lt;/li&gt;
&lt;li&gt;Java IDL, and IDL Implementation for CORBA Interoperability.&lt;/li&gt;
&lt;li&gt;Collection Framework&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;b style=&quot;color: #38761d;&quot;&gt;J2SE 1.3 &lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;HotSpot JVM Included&lt;/li&gt;
&lt;li&gt;RMI was modified to support optional compatibilty with CORBA&lt;/li&gt;
&lt;li&gt;JAvaSound&lt;/li&gt;
&lt;li&gt;Java Naming and Directory inteface (JNDI) included in core libraries (previously available as an extension)&lt;/li&gt;
&lt;li&gt;Java platform Debugger Architecture(JPDA)&lt;/li&gt;
&lt;/ul&gt;&lt;b style=&quot;color: #38761d;&quot;&gt;J2SE 1.4 &lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Assesrt Keyword&lt;/li&gt;
&lt;li&gt;Regular expression modedled after perl regular expressions.&lt;/li&gt;
&lt;li&gt;exception chaining allows an exception to encapsulate original/ lower-level exception&lt;/li&gt;
&lt;li&gt;Internet protocal version (IPV6) support&lt;/li&gt;
&lt;li&gt;non-blocking NIO (new input / output)&lt;/li&gt;
&lt;li&gt;Logging API&lt;/li&gt;
&lt;li&gt;Image I/O API for reading and writing images in formats like JPEG and PNG&lt;/li&gt;
&lt;li&gt;Integrated XML parser and XSLT processor(JAXP)&lt;/li&gt;
&lt;li&gt;Integrated Security and cryptography&lt;/li&gt;
&lt;/ul&gt;&lt;b style=&quot;color: #38761d;&quot;&gt;J2SE 5.0&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Generics&lt;/li&gt;
&lt;li&gt;Metadata&lt;/li&gt;
&lt;li&gt;Autoboxing / unboxing&lt;/li&gt;
&lt;li&gt;Enumerations&lt;/li&gt;
&lt;li&gt;Swing New skinnable look and feel, called synth&lt;/li&gt;
&lt;li&gt;Varargs&lt;/li&gt;
&lt;li&gt;Enchanced &quot;for loop&quot;&lt;/li&gt;
&lt;li&gt;Fix the previously broken semantics of the java Memory model, which defines how threads interact through memory.&lt;/li&gt;
&lt;li&gt;Automatic Stud generation for RMI objects&lt;/li&gt;
&lt;/ul&gt;&lt;b style=&quot;color: #38761d;&quot;&gt;Java SE 6&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Support for order win9x sessions dropped&lt;/li&gt;
&lt;li&gt;Scripting Language Support (JSR 223)&lt;/li&gt;
&lt;li&gt;Dramatic performance improvements for the core &lt;/li&gt;
&lt;li&gt;platform and swing&lt;/li&gt;
&lt;li&gt;Improved webservice support through JAX WS&lt;/li&gt;
&lt;li&gt;JDBC 4.0 support&lt;/li&gt;
&lt;li&gt;JAva compiler aPI&lt;/li&gt;
&lt;li&gt;Upgrade of JAXB to version2.0&lt;/li&gt;
&lt;li&gt;support for pluggable annotations&lt;/li&gt;
&lt;li&gt;Many GUI improvements&lt;/li&gt;
&lt;/ul&gt;&lt;b style=&quot;color: #38761d;&quot;&gt;Java SE7&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;JVM support for dynamic languages, following the prototyping work currently done on the Multi language virtual machine&lt;/li&gt;
&lt;li&gt;A new library for parallel computing pn Multi&amp;nbsp; core processors&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/166816911705825044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2010/10/evolution-of-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/166816911705825044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/166816911705825044'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2010/10/evolution-of-java.html' title='The Evolution of Java'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-3439361789869181102</id><published>2010-10-27T10:58:00.000-07:00</published><updated>2010-10-27T10:58:02.627-07:00</updated><title type='text'>The History of Java</title><content type='html'>&lt;i style=&quot;color: red;&quot;&gt;&lt;b&gt;The History of JAVA&lt;/b&gt;&lt;/i&gt; &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Java is related to C++, which is a direct descendant of C. Much of the character of java is inherited from these two languages. From C, Java derives its Syntax. Many of java&#39;s Object-Oriented features were influenced by C++. In fact, several of Java&#39;s defining characteristics come from or are responses to its predecessors.&lt;br /&gt;
&lt;br /&gt;
&lt;i style=&quot;color: red;&quot;&gt;&lt;b&gt;The Creation of JAVA&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Java was conceived by James Gosling, Patrick Naughton, Chris Warth, Ed Frank and Mike Sheridan at Sun Micro Systems, Inc in 1991. It took 18 moths to develop the first working version. The language was initially called &quot;Oak&quot; but was renamed &quot;Java&quot; in 1995. Between the initial&amp;nbsp; implementation of Oak in the fall of 1992 and the public announcement of java in the spring of 1995, many more people contributed ti the design and evolution of the language. Bill joy, Arthur van Hoff, Jonathan Payne, Frank Yellin and Tim Lindholm were key contributors to the maturing of the original prototype.&lt;br /&gt;
&lt;br /&gt;
&lt;i style=&quot;color: red;&quot;&gt;&lt;b&gt;Java&#39;s Magic: The Bytecode&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The key that allows Java to solve both the security and the portability problems just described in that the output of a Java compiler is not executable code. Rather it is bytecode. Bytecode is a highly optimized set of instructions designed to be executed by the Java run-time system, which is called Java Virtual Machine(JVM). In essence the original JVM was designed as an interpreted for bytecode.&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;i style=&quot;color: red;&quot;&gt;&lt;b&gt;The Java Buzzwords&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Simple&lt;/li&gt;
&lt;li&gt;Secure&lt;/li&gt;
&lt;li&gt;Portable&lt;/li&gt;
&lt;li&gt;Object-orinted&lt;/li&gt;
&lt;li&gt;Robust&lt;/li&gt;
&lt;li&gt;Multithreaded&lt;/li&gt;
&lt;li&gt;Architecure-neutral&lt;/li&gt;
&lt;li&gt;Interpreted&lt;/li&gt;
&lt;li&gt;High performance&lt;/li&gt;
&lt;li&gt;Distributed&lt;/li&gt;
&lt;li&gt;Dynamic&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/3439361789869181102/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2010/10/history-of-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/3439361789869181102'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/3439361789869181102'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2010/10/history-of-java.html' title='The History of Java'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8773886707854553311.post-6235735616205399314</id><published>2010-10-27T10:40:00.000-07:00</published><updated>2010-10-27T10:40:28.615-07:00</updated><title type='text'>Understanding OOP Concepts</title><content type='html'>&amp;nbsp;OOPs:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Classes--The &quot;Blueprints&quot; for an object and the actual code that defines the properties and methods.&lt;br /&gt;
&lt;br /&gt;
Objects-- Running instances of a class that contain all the internal data and state information needed for your application to function.&lt;br /&gt;
&lt;br /&gt;
Inheritance-- The ability to define a class of one kind as being a subtype of a different kind of class (much the same way a square is a kind of rectangle)&lt;br /&gt;
&lt;br /&gt;
Polymorphism-- Allows a class to be defined as being a member of more than one category of classes (just a car is a &quot;thing with an engine&quot; and &quot;a thing with wheels&quot;)&lt;br /&gt;
&lt;br /&gt;
Interfaces-- A way of specifying that an object is capable of doing something without actually defining how it is to be done (e.g a dog and a human are &quot;things that walk&quot; but they do it very differently ) &lt;br /&gt;
&lt;br /&gt;
Encapsulation-- The ability of an object to project access to its internal data.</content><link rel='replies' type='application/atom+xml' href='http://vinayguntaka.blogspot.com/feeds/6235735616205399314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vinayguntaka.blogspot.com/2010/10/understanding-oop-concepts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/6235735616205399314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8773886707854553311/posts/default/6235735616205399314'/><link rel='alternate' type='text/html' href='http://vinayguntaka.blogspot.com/2010/10/understanding-oop-concepts.html' title='Understanding OOP Concepts'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08298934580904916127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>