<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8329086772546213543</id><updated>2011-11-27T15:17:46.658-08:00</updated><category term='jdbc interview'/><title type='text'>Career Speak</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://stepintofuture.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8329086772546213543/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://stepintofuture.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>sureshkumar</name><uri>http://www.blogger.com/profile/07546589267927657994</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8329086772546213543.post-820773084415113484</id><published>2010-11-30T01:27:00.000-08:00</published><updated>2010-11-30T01:31:31.793-08:00</updated><title type='text'>Struts Framework-Interview-1</title><content type='html'>Struts Framework&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.2shared.com/document/jjM0rLmu/interview1.html"&gt;Click&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8329086772546213543-820773084415113484?l=stepintofuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stepintofuture.blogspot.com/feeds/820773084415113484/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8329086772546213543&amp;postID=820773084415113484' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8329086772546213543/posts/default/820773084415113484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8329086772546213543/posts/default/820773084415113484'/><link rel='alternate' type='text/html' href='http://stepintofuture.blogspot.com/2010/11/struts-framework-interview-1.html' title='Struts Framework-Interview-1'/><author><name>sureshkumar</name><uri>http://www.blogger.com/profile/07546589267927657994</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8329086772546213543.post-783236232240575825</id><published>2008-07-29T18:10:00.000-07:00</published><updated>2008-07-29T18:18:51.480-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jdbc interview'/><title type='text'>j2ee-JDBC interview questions</title><content type='html'>&lt;p&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;&lt;span style=""&gt;                        &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;&lt;span style="font-size: 20pt;"&gt;JDBC&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;1) What are the steps in the JDBC connection?&lt;/b&gt;&lt;/span&gt;&lt;span class="answers"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;While making a JDBC connection we go through the following steps : &lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;Step 1 : Register the database driver by using : &lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;Class.forName(\" driver classs for that specific database\" ); &lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;Step 2 : Now create a database connection using : &lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;Connection con = DriverManager.getConnection(url,username,password); &lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;Step 3: Now Create a query using : &lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;Statement stmt = Connection.Statement(\"select * from TABLE NAME\"); &lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;Step 4 : Exceute the query : &lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;stmt.exceuteUpdate(); &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;2) What is JDBC?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;JDBC is a set of Java API for executing SQL statements. This API consists of a set of&lt;span style=""&gt;  &lt;/span&gt;classes and interfaces to enable programs to write pure Java Database applications.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;3) What are drivers available?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;            &lt;/span&gt;a)&lt;span style=""&gt;     &lt;/span&gt;JDBC-ODBC Bridge driver&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-indent: 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;b)&lt;span style=""&gt;   &lt;/span&gt;&lt;span style=""&gt;      &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;Native API Partly-Java driver&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-indent: 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;c)&lt;span style=""&gt;         &lt;/span&gt; JDBC-Net Pure Java driver&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-indent: 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;d)&lt;span style=""&gt;         &lt;/span&gt; Native-Protocol Pure Java driver&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;4) What is the difference between JDBC and ODBC?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;a)&lt;span style=""&gt;         &lt;/span&gt;OBDC is for Microsoft and JDBC is for Java applications.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;b)&lt;span style=""&gt;         &lt;/span&gt;ODBC can't be directly used with Java because it uses a C interface.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;c)&lt;span style=""&gt;         &lt;/span&gt;ODBC&lt;span style=""&gt;  &lt;/span&gt;makes use of pointers which have been removed totally from Java.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;d)&lt;span style=""&gt;         &lt;/span&gt;ODBC mixes simple and advanced features together and has complex options for simple queries. But JDBC is designed to keep things simple while allowing advanced capabilities when required.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;e)&lt;span style=""&gt;         &lt;/span&gt;ODBC requires manual installation of the ODBC driver manager and driver on all client machines. JDBC drivers are written in Java and JDBC code is automatically installable, secure, and portable on all platforms.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;f)&lt;span style=""&gt;          &lt;/span&gt;JDBC API is a natural Java interface and is built on ODBC. JDBC retains some of the basic features of ODBC.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;5) What are the types of JDBC Driver Models and explain them?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;There are two types of JDBC Driver Models and they are:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;a)&lt;span style=""&gt;         &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;Two tier model &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;b)&lt;span style=""&gt;      &lt;/span&gt;Three tier model&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Two tier model:&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt; In this model, Java applications interact directly with the database. A JDBC driver is required to communicate with the particular database management system that is being accessed. SQL statements are sent to the database and the results are given to user. This model is referred to as client/server configuration where user is the client and the machine that has the database is called as the server.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Three tier model:&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt; A middle tier is introduced in this model. The functions of this model are:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;a)&lt;span style=""&gt;            &lt;/span&gt;Collection of SQL statements from the client and handing it over to the database,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;b)&lt;span style=""&gt;            &lt;/span&gt;Receiving results from database to the client and&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;c)&lt;span style=""&gt;            &lt;/span&gt;Maintaining control over accessing and updating of the above.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;6) What are the steps involved for making a connection with a database or how do you connect to a database? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;a)&lt;span style=""&gt;    &lt;/span&gt;Loading the driver : To load the driver, Class.forName( ) method is used.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;             &lt;/span&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;            &lt;/span&gt;When the driver is loaded, it registers itself with the java.sql.DriverManager class as an available database driver.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;b)&lt;span style=""&gt;         &lt;/span&gt;Making a connection with database : To open a connection to a given database, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;DriverManager.getConnection( ) method is used.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;           &lt;/span&gt;Connection con = DriverManager.getConnection ("jdbc:odbc:somedb", "user",&lt;span style=""&gt;  &lt;/span&gt;"password");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;c)&lt;span style=""&gt;            &lt;/span&gt;Executing SQL statements : To execute a SQL query, java.sql.statements class is used.&lt;span style=""&gt;   &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;createStatement( ) method of Connection to obtain a new Statement object.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;            &lt;/span&gt;Statement stmt&lt;span style=""&gt;  &lt;/span&gt;= con.createStatement( );&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;A query that returns data can be executed using the executeQuery( ) method of&lt;span style=""&gt;  &lt;/span&gt;Statement. This method &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;executes the statement and returns a java.sql.ResultSet that encapsulates the retrieved data: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;            &lt;/span&gt;ResultSet rs = stmt.executeQuery("SELECT * FROM some table");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;d)&lt;span style=""&gt;         &lt;/span&gt;Process the results : ResultSet returns one row at a time. Next( ) method of ResultSet&lt;span style=""&gt;  &lt;/span&gt;object can be called to move to the next row.&lt;span style=""&gt;  &lt;/span&gt;The getString( ) and getObject( ) methods are used for retrieving&lt;span style=""&gt;  &lt;/span&gt;column values: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;                       &lt;/span&gt;while(rs.next( ) ) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;                           &lt;/span&gt;String event = rs.getString("event");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;                           &lt;/span&gt;Object count = (Integer) rs.getObject("count");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;7) What type of driver did you use in project?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;JDBC-ODBC Bridge driver (is a driver that uses native(C language) libraries and makes calls to an existing ODBC driver to access a database engine). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;8) What are the types of statements in JDBC?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;     &lt;/span&gt;Statement&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;-- To be used createStatement() method for executing single SQL statement&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;     &lt;/span&gt;&lt;b&gt;PreparedStatement&lt;span style=""&gt;  &lt;/span&gt;--&lt;/b&gt; To be used preparedStatement() method for executing same SQL statement over and over .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;         &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;     &lt;/span&gt;CallableStatement&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;-- To be used prepareCall( ) method for multiple SQL statements over and over.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;9) What is stored procedure?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;      &lt;/span&gt;Stored procedure is a group of SQL statements that forms a logical unit and performs a particular task. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;     &lt;/span&gt;Stored Procedures are used to encapsulate a set of operations or queries to execute on database. Stored procedures can be compiled and executed with different parameters and results and may have any combination of input/output parameters.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;10) How to create and call stored procedures?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;To create stored procedures:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;Create procedure procedurename (specify in, out and in out parameters)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;BEGIN &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;Any multiple SQL statement;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;END; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;         &lt;/span&gt;To call stored procedures:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;CallableStatement&lt;span style=""&gt;  &lt;/span&gt;csmt&lt;span style=""&gt;  &lt;/span&gt;= con.prepareCall("{call procedure name(?,?)}");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;csmt.registerOutParameter(column no., data type);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;csmt.setInt(column no., column name)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;csmt.execute( );&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;         &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;11)Why do we have index table in the database?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Because the index table contain the information of the other tables. It will be faster if we access the index table to find out what the other contain.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;12) Give an example of using JDBC access the database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Answer: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;try&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Class.forName("register the driver");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Connection con = DriverManager.getConnection("url of db", "username","password");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Statement state = con.createStatement();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;state.executeUpdate("create table testing(firstname varchar(20), lastname varchar(20))");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;state.executeQuery("insert into testing values('phu','huynh')");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;state.close();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;con.close();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;catch(Exception e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;System.out.println(e);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;13)What are the two major components of JDBC? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-indent: 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;One implementation interface for database manufacturers, the other implementation interface for application and applet writers. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;14)What is JDBC Driver interface? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-indent: 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;The JDBC Driver interface provides vendor-specific implementations of the abstract classes provided by the JDBC API. Each vendors driver must provide implementations of the java.sql.Connection,Statement,PreparedStatement, CallableStatement, ResultSet and Driver. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;15)What are the common tasks of JDBC?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-indent: 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;1.Create an instance of a JDBC driver or load JDBC drivers through jdbc.drivers; 2. Register a driver; 3. Specify a database; 4. Open a database connection; 5. Submit a query; 6. Receive results. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;16)What packages are used by JDBC? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-indent: 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;There are 8 packages: java.sql.Driver, Connection,Statement, PreparedStatement, CallableStatement, ResultSet, ResultSetMetaData, DatabaseMetaData. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;17)What are the flow statements of JDBC? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-indent: 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;A URL string --&gt;getConnection--&gt;DriverManager--&gt;Driver--&gt;Connection--&gt;Statement--&gt;executeQuery--&gt;ResultSet. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;18)What are the steps involved in establishing a connection? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-indent: 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;This involves two steps: (1) loading the driver and (2) making the connection. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;19)How can you load the drivers? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-indent: 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Loading the driver or drivers you want to use is very simple and involves just one line of code. If, for example, you want to use the JDBC-ODBC Bridge driver, the following code will load it: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Eg.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Your driver documentation will give you the class name to use. For instance, if the class name is jdbc.DriverXYZ , you would load the driver with the following line of code: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;E.g.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Class.forName("jdbc.DriverXYZ");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;20)What Class.forName will do while loading drivers? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-indent: 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;It is used to create an instance of a driver and register it with the DriverManager. When you have loaded a driver, it is available for making a connection with a DBMS. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;21)How can you make the connection?&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-indent: 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;In establishing a connection is to have the appropriate driver connect to the DBMS. The following line of code illustrates the general idea: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;E.g.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;String url = "jdbc:odbc:Fred";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Connection con = DriverManager.getConnection(url, "Fernanda", "J8");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;22)How can you create JDBC statements? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-indent: 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;A Statement object is what sends your SQL statement to the DBMS. You simply create a Statement object and then execute it, supplying the appropriate execute method with the SQL statement you want to send. For a SELECT statement, the method to use is executeQuery. For statements that create or modify tables, the method to use is executeUpdate. E.g. It takes an instance of an active connection to create a Statement object. In the following example, we use our Connection object con to create the Statement object stmt : &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Statement stmt = con.createStatement();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;23)How can you retrieve data from the ResultSet? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-indent: 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;First JDBC returns results in a ResultSet object, so we need to declare an instance of the class ResultSet to hold our results. The following code demonstrates declaring the ResultSet object rs. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;E.g.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;ResultSet rs = stmt.executeQuery("SELECT COF_NAME, PRICE FROM COFFEES");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Second:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;String s = rs.getString("COF_NAME");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;The method getString is invoked on the ResultSet object rs , so getString will retrieve (get) the value stored in the column COF_NAME in the current row of rs &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;24)What are the different types of Statements? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-indent: 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;1.Statement (use createStatement method) 2. Prepared Statement (Use prepareStatement method) and 3. Callable Statement (Use prepareCall) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;25)How can you use PreparedStatement? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-indent: 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;This special type of statement is derived from the more general class, Statement. If you want to execute a Statement object many times, it will normally reduce execution time to use a PreparedStatement object instead. The advantage to this is that in most cases, this SQL statement will be sent to the DBMS right away, where it will be compiled. As a result, the PreparedStatement object contains not just an SQL statement, but an SQL statement that has been precompiled. This means that when the PreparedStatement is executed, the DBMS can just run the PreparedStatement 's SQL statement without having to compile it first. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;E.g.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;PreparedStatement updateSales = con.prepareStatement("UPDATE COFFEES SET SALES = ? WHERE COF_NAME LIKE ?");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;26)How to call a Stored Procedure from JDBC? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-indent: 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;The first step is to create a CallableStatement object. As with Statement an and PreparedStatement objects, this is done with an open Connection object. A CallableStatement object contains a call to a stored procedure; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;E.g.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;CallableStatement cs = con.prepareCall("{call SHOW_SUPPLIERS}");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;ResultSet rs = cs.executeQuery();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;27)How to Retrieve Warnings? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-indent: 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;SQLWarning objects are a subclass of SQLException that deal with database access warnings. Warnings do not stop the execution of an application, as exceptions do; they simply alert the user that something did not happen as planned. A warning can be reported on a Connection object, a Statement object (including PreparedStatement and CallableStatement objects), or a ResultSet object. Each of these classes has a getWarnings method, which you must invoke in order to see the first warning reported on the calling object &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;E.g.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;SQLWarning warning = stmt.getWarnings();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;if (warning != null) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;while (warning != null) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;System.out.println("Message: " + warning.getMessage());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;System.out.println("SQLState: " + warning.getSQLState());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;System.out.print("Vendor error code: ");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;System.out.println(warning.getErrorCode());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;warning = warning.getNextWarning();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;28)How to Make Updates to Updatable Result Sets? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-indent: 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Another new feature in the JDBC 2.0 API is the ability to update rows in a result set using methods in the Java programming language rather than having to send an SQL command. But before you can take advantage of this capability, you need to create a ResultSet object that is updatable. In order to do this, you supply the ResultSet constant CONCUR_UPDATABLE to the createStatement method. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;E.g.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Connection con = DriverManager.getConnection("jdbc:mySubprotocol:mySubName");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;ResultSet.CONCUR_UPDATABLE);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;ResultSet uprs = ("SELECT COF_NAME, PRICE FROM COFFEES");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;29). What is JDBC ? what are its advantages ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;It is an API .The latest version of jdbc api is (3.0).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;The JDBC 3.0 API is divided into two packages:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;(1) java.sql and (2) javax.sql. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;Both packages are included in the J2SE and J2EE platforms.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;b&gt;Advantages:&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;      &lt;/span&gt;The JDBC API can be used to interact with multiple data sources in a distributed, heterogenous environment.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;      &lt;/span&gt;It&lt;span style=""&gt;  &lt;/span&gt;can connect to any of the database from java language.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;      &lt;/span&gt;It can switch over to any backend database without changing java code or by minute changes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;30). How many JDBC Drivers are there ? what are they?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;There are 4 types of JDBC drivers.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;a. JDBC-ODBC Bridge Driver(Type-1 driver)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;b. Native API Partly Java Driver(Type-2 driver)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;c. Net protocol pure Java Driver(Type-3 driver)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;d. Native protocol Pure Java Driver(Type-4 driver)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;31. Explain about JDBC-ODBC driver(Type-1) ? When this type of driver is used ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt; &lt;/span&gt;In this mechanism the flow of execution will be &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;Java code(JDBC API)&lt;------&gt;JDBC-ODBC bridge driver&lt;-------&gt;ODBC API&lt;-------&gt;ODBC Layer&lt;--------&gt;DataBase&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;This type of JDBC Drivers provides a bridge between JDBC API and ODBC API.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;This Bridge(JDBC-ODBC bridge) translates standard JDBC calls to Corresponding ODBC Calls, and&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;send them to ODBC database via ODBC Libraries.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;The JDBC API is based on ODBC API.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;ODBC(Open Database Connectivity)is Microsoft's API for Database drivers.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;ODBC is based on X/Open Call Level Interface(CLI)specification for database access.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;The URL and class to be loaded for this type of driver are&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;Class :- sun.jdbc.odbc.JdbcOdbcDriver&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;URL&lt;span style=""&gt;  &lt;/span&gt; :- jdbc:odbc:dsnname&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;32. Explain about Type-2 driver ? When this type of driver is used ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;The Drivers which are written in Native code will come into this category&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;In this mechanism the flow of Execution will be &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;java code(JDBC API)&lt;------&gt;Type-2 driver(jdbc driver)&lt;-------&gt;Native API(vendor specific)&lt;-------&gt;DataBase&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;When database call is made using JDBC,the driver translates the request into vendor-specific API calls.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;The database will process the requet and sends the results back through the Native API ,which will&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;forward them back to the JDBC dirver. The JDBC driver will format the results to conform to the JDBC&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;standard and return them to the application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;33. Explain about Type-3 driver ? When this type of driver is used ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt; &lt;/span&gt;In this mechanism the flow of Execution will be &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;java code(JDBC API)&lt;------&gt;JDBC driver&lt;-------&gt;JDBC driver server&lt;--------&gt;Native driver&lt;-------&gt;DataBase&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;The Java Client Application sends the calls to the Intermediate data access server(jdbc driver server)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;The middle tier then handles the requet using other driver(Type-II or Type-IV drivers) to complete the request.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;34. Explain about Type-4 driver ? When this type of driver is used ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;This is a pure java driver(alternative to Type-II drivers).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;In this mechanism the flow of Execution will be &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;java code(JDBC API)&lt;------&gt;Type-4 driver(jdbc driver)&lt;-------&gt;DataBase&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;These type of drivers convert the JDBC API calls to direct network calls using&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;vendor specific networking protocal by making direct socket connection with&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;examples of this type of drivers are &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;1.Tabular Data Stream for Sybase&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;2.Oracle Thin jdbc driver for Oracle&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;span style=""&gt;                     &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;35. Which Driver is preferable for using JDBC API in Applets?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Type-4 Drivers.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;36.Write the Syntax of URL to get connection ? Explain?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Syntax:- jdbc:&lt;subprotocal&gt;:&lt;subname&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;jdbc -----&gt; is a protocal .This is only allowed protocal in JDBC.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;subprotocal&gt; ----&gt; The subprotocal is used to identify a database driver,or the&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;name of the database connectivity mechanism, choosen by the database driver providers.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;subname&gt;&lt;span style=""&gt;  &lt;/span&gt;-------&gt;&lt;span style=""&gt;  &lt;/span&gt;The syntax of the subname is driver specific. The driver may choose any&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;syntax appropriate for its implementation&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;ex: jdbc:odbc:dsn&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;jdbc:oracle:oci8:@ database name.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;jdbc:orale:thin:@ database name:port number:SID&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;37.How do u Load a driver ? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Using Driver Class.forName(java.lang.String driverclass) or registerDriver(Driver driver) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;38.what are the types of resultsets in JDBC3.0 ?How you can retrieve information of resultset?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;ScrollableResultSet and ResultSet.We can retrieve information of resultset by using java.sql.ResultSetMetaData interface.You can get the instance by calling the method getMetaData() on ResulSet object.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;39.write the steps to Connect database?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;Class.forName(The class name of a spasific driver);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;Connection c=DriverManager.getConnection(url of a spasific driver,user name,password);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;Statement s=c.createStatement();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;               &lt;/span&gt;(or)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;PreparedStatement p=c.prepareStatement();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;               &lt;/span&gt;(or)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;CallableStatement cal=c.prpareCall();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;Depending upon the requirement.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;40.Can java objects be stored in database? how?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Yes.We can store java objects, BY using setObject(),setBlob() and setClob() methods in PreparedStatement&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;41.what do u mean by isolation level? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;Isolation means that the business logic can proceed without&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;consideration for the other activities of the system.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;42.How do u set the isolation level?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;By using setTransactionIsolation(int level) in java.sql.Connection interface.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;level MEANS:-&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;static final int TRANSACTION_READ_UNCOMMITTED //cannot prevent any reads.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;static final int TRANSACTION_READ_COMMITTED&lt;span style=""&gt;   &lt;/span&gt;//prevents dirty reads&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;static final int TRANSACTION_REPEATABLE_READ&lt;span style=""&gt;  &lt;/span&gt;//prevents dirty reads &amp;amp; non-repeatable read.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;static final int TRANSACTION_SERIALIZABLE&lt;span style=""&gt;     &lt;/span&gt;//prevents dirty reads , non-&lt;span style=""&gt;   &lt;/span&gt;repeatable read &amp;amp; phantom read.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;These are the static final fields in java.sql.Connection interface.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;43. What is a dirty read? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;A Dirty read allows a row changed by one transaction to be&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;read by another transaction before any change in the row &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;have been committed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;This problem can be solved by setting the transaction isolation &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;level to TRANSACTION_READ_COMMITTED&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;44. what is a non-repeatable read ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;A non-repeatable read is where one transaction reads a row, a second&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;transaction alters or deletes the row, and the first transaction &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;re-reads the row,getting different values the second time.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;This problem can be solved by setting the transaction isolation &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;level to TRANSACTION_REPEATABLE_READ&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;45. what is phantom read?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;A phantom read is where one transaction reads all rows that satisfy&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;a WHERE condition,a second transaction inserts a row that satisfies &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;that WHERE condition,and the first transaction re-reads for the same &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;condition,retrieving the additional 'phantom' row in the second read&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;This problem can be solved by setting the transaction isolation &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;level to TRANSACTION_SERIALIZABLE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;47.How to retrieve the information about the database ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt; &lt;/span&gt;We can retrieve the info about the database by using inerface &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;java.sql.DatabaseMetaData &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;We can get this object by using getMetaData() method in &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;Connection interface.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;48.what are the Different types of exceptions in jdbc?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;BatchUpdateException &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;DataTruncation &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;SQLException &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;SQLWarning &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;49.How to execute no of queries at one go?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;By using a batchUpdate's (ie throw addBatch() and executeBatch()) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;in java.sql.Statement interface,or by using procedures.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;50. What are the advantages of connection pool.?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Performance &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;51.In which interface the methods commit() &amp;amp; rollback() are defined ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;A.java.sql.Connection interface&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;52.How to store images in database?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Using binary streams (i.e. getBinaryStream (), setBinaryStream ()). But it is not visible in database, it is stored in form of bytes, to make it visible we have to use any one front-end tool.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;53.How to check null value in JDBC?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;By using the method wasNull() in ResultSet ,it returns boolean value.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;Returns whether the last column read had a value of SQL NULL.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;Note that you must first call one of the getXXX methods on a column to try to read its&lt;span style=""&gt;   &lt;/span&gt;value and then call the method wasNull to see if the value read was SQL NULL.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;54.Give one Example of static Synchronized method in JDBC API?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;getConnection() method in DriverManager class.Which is used to get object of Connection interface.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;55.What is a Connection?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt; &lt;/span&gt;Connection is an interface which is used to make a connection between client and Database (ie opening a session with a particular database).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;56.what is the difference between execute() ,executeUpdate() and executeQuery() ? where we will use them?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;b&gt;execute()&lt;/b&gt; method returns a boolean value (ie if the given query&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;returns a resutset then it returns true else false),so depending upon &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;the return value we can get the ResultSet object (getResultset())or&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;we can know how many rows have bean affected by our query &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;(getUpdateCount()).That is we can use this method for Fetching &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;queries and Non-Fetching queries.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;Fetching queries are the queries which are used to fetch the records from database (ie which returns resutset) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;ex: Select * from emp.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;Non-Fetching queries are the queries which are used to update,insert,create or delete the records from database &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;ex: update emp set sal=10000 where empno=7809.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;b&gt;executeUpdate()&lt;/b&gt; method is used for nonfetching queries.which returns int value.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;b&gt;executeQuery() method&lt;/b&gt; is used for fetching queries which returns ResulSet object ,Which contains methods to fetch the values.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;58). Using a Prepared Statement&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;A prepared statement should be used in cases where a particular SQL statement is used frequently. The prepared statement is more expensive to set up but executes faster than a statement. This example demonstrates a prepared statement for getting all rows from a table called ''mytable'' whose column COL_A equals ''Patrick Chan''. This example also demonstrates a prepared statement for updating data in the table. In particular, for all rows whose column COL_B equals 123, column COL_A is set to ''John Doe''. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;try {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;// Retrieving rows from the database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;PreparedStatement stmt = connection.prepareStatement(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;"SELECT * FROM mytable WHERE COL_A = ?");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;int colunm = 1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;stmt.setString(colunm, "Patrick Chan");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;ResultSet rs = stmt.executeQuery();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;// Updating the database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;stmt = connection.prepareStatement(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;"UPDATE mytable SET COL_A = ? WHERE COL_B = ?");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;colunm = 1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;stmt.setString(colunm, "John Doe");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;colunm = 2;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;stmt.setInt(colunm, 123);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;int numUpdated = stmt.executeUpdate();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;} catch (SQLException e) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;                        &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;59.What are the types of JDBC drivers ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Type 1- JDBC-ODBC Bridge&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Type 2- Native API Driver&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Type 3 - JDBC-Net,Java Pure Driver&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Type 4- Native Protocol, Pure Java Driver&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;60.Which among the four driver is pure Java driver ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Type 3 and Type 4&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;61.How do you connect without the Class.forName (" ") ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;It is not possible not connect&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;62.What does Class.forName return ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Class Name&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;63.Why is preparedStatement,CallableStatement used for?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Preapred Stmt -SQL in the database is a precompiled, by the database for faster execution&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;CallableStmt-JDBC allows use of stored procedures by the CallableStatement class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;A CallableStatement object is created by the preaprecall()method in the connection object&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: -0.25in;"&gt;&lt;b&gt;&lt;span style=""&gt;      &lt;/span&gt;64) Explain the role of Driver in JDBC?&lt;br /&gt;&lt;/b&gt;The JDBC Driver provides vendor-specific implementations of the abstract classes provided by the JDBC API. Each vendors driver must provide implementations of the java.sql.Connection,Statement,PreparedStatement, CallableStatement, ResultSet and Driver.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;65) Is java.sql.Driver a class or an Interface ?&lt;br /&gt;&lt;/b&gt;It's an interface.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;66) Is java.sql.DriverManager a class or an Interface ?&lt;br /&gt;&lt;/b&gt;It's a class. This class provides the static getConnection method, through which the database connection is obtained.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;67) Is java.sql.Connection a class or an Interface ?&lt;br /&gt;&lt;/b&gt;java.sql.Connection is an interface. The implmentation is provided by the vendor specific Driver.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;68) Is java.sql.Statement a class or an Interface ?&lt;br /&gt;&lt;/b&gt;java.sql.Statement,java.sql.PreparedStatement and java.sql.CallableStatement are interfaces.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;69) Which interface do PreparedStatement extend?&lt;br /&gt;&lt;/b&gt;java.sql.Statement&lt;br /&gt;&lt;br /&gt;&lt;b&gt;70) Which interface do CallableStatement extend?&lt;br /&gt;&lt;/b&gt;CallableStatement extends PreparedStatement.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;71) What is the purpose Class.forName("") method?&lt;br /&gt;&lt;/b&gt;The Class.forName("") method is used to load the driver. &lt;br /&gt; &lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br /&gt; &lt;!--[endif]--&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: -0.25in;"&gt;&lt;b&gt;&lt;span style=""&gt;       &lt;/span&gt;72) Do you mean that Class.forName("") method can only be used to load a driver?&lt;br /&gt;&lt;/b&gt;The Class.forName("") method can be used to load any class, not just the database vendor driver class.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;73) Which statement throws ClassNotFoundException in SQL code block? and why?&lt;br /&gt;&lt;/b&gt;Class.forName("") method throws ClassNotFoundException. This exception is thrown when the JVM is not able to find the class in the classpath.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;74) What exception does Class.forName() throw?&lt;br /&gt;&lt;/b&gt;ClassNotFoundException.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;75) What is the return type of Class.forName() method ?&lt;br /&gt;&lt;/b&gt;java.lang.Class&lt;br /&gt;&lt;br /&gt;&lt;b&gt;76) Can an Interface be instantiated? If not, justify and explain the following line of code:&lt;br /&gt;Connection con = DriverManager.getConnection("dsd","sds","adsd");&lt;br /&gt;&lt;/b&gt;An interface cannot be instantiated. But reference can be made to a interface. When a reference is made to interface, the refered object should have implemented all the abstract methods of the interface. In the above mentioned line, DriverManager.getConnection method returns Connection Object with implementation for all abstract methods.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;77) What type of a method is getConnection()?&lt;br /&gt;&lt;/b&gt;static method.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;78) What is the return type for getConnection() method?&lt;br /&gt;&lt;/b&gt;Connection object.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;79) What is the return type for executeQuery() method?&lt;br /&gt;&lt;/b&gt;ResultSet&lt;br /&gt;&lt;br /&gt;&lt;b&gt;80) What is the return type for executeUpdate() method and what does the return type indicate?&lt;br /&gt;&lt;/b&gt;int. It indicates the no of records affected by the query.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;81) What is the return type for execute() method and what does the return type indicate?&lt;br /&gt;&lt;/b&gt;boolean. It indicates whether the query executed sucessfully or not. &lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: -0.25in;"&gt;&lt;br /&gt;&lt;b&gt;82) Is Resultset a Classor an interface?&lt;br /&gt;&lt;/b&gt;Resultset is an interface. &lt;br /&gt; &lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br /&gt; &lt;!--[endif]--&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: -0.25in;"&gt;&lt;b&gt;&lt;span style=""&gt;     &lt;/span&gt;83) What is the advantage of PrepareStatement over Statement?&lt;br /&gt;&lt;/b&gt;PreparedStatements are precompiled and so performance is better. PreparedStatement objects can be reused with passing different values to the queries.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;84) What is the use of CallableStatement?&lt;br /&gt;&lt;/b&gt;CallableStatement is used to execute Stored Procedures.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;85) Name the method, which is used to prepare CallableStatement?&lt;br /&gt;&lt;/b&gt;CallableStament.prepareCall().&lt;br /&gt;&lt;br /&gt;&lt;b&gt;86) What do mean by Connection pooling? &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify; text-indent: -0.25in;"&gt;&lt;b&gt;&lt;br /&gt;&lt;span style=""&gt;                             &lt;/span&gt;&lt;/b&gt;Opening and closing of database connections is a costly excercise. So a pool of database connections is obtained at start up by the application server and maintained in a pool. When there is a request for a connection from the application, the application server gives the connection from the pool and when closed by the application is returned back to the pool. Min and max size of the connection pool is configurable. This technique provides better handling of database connectivity.&lt;span style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;87. Which methods and classes are used for connection pooling?&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;88). How will you perform transactions using JDBC?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;89). What is difference between PreparedStatement and Statement?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;90). What is the difference between ExecuteUpdate and ExecuteQuery?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;91). How do you know which driver is connected to a database?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;92). What is DSN and System DSN and differentiate these two?&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: 200%;"&gt;&lt;b&gt;93). How you can know about drivers and database information?&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: 200%;"&gt;&lt;b&gt;94). If you are truncated using JDBC, How can you know? That how much&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: 200%;"&gt;&lt;b&gt;&lt;span style=""&gt; &lt;/span&gt;data is truncated?&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: 200%;"&gt;&lt;b&gt;95). What are the Normalization Rules? Define the Normalization?&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8329086772546213543-783236232240575825?l=stepintofuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stepintofuture.blogspot.com/feeds/783236232240575825/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8329086772546213543&amp;postID=783236232240575825' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8329086772546213543/posts/default/783236232240575825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8329086772546213543/posts/default/783236232240575825'/><link rel='alternate' type='text/html' href='http://stepintofuture.blogspot.com/2008/07/j2ee-jdbc-interview-questions.html' title='j2ee-JDBC interview questions'/><author><name>sureshkumar</name><uri>http://www.blogger.com/profile/07546589267927657994</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8329086772546213543.post-2003224704265875664</id><published>2008-07-22T08:12:00.001-07:00</published><updated>2008-07-22T08:29:41.743-07:00</updated><title type='text'>JAVA-EXCEPTION HANDLING</title><content type='html'>&lt;p style="margin-left: -0.75in; text-align: center;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;&lt;span style=""&gt;                              &lt;/span&gt;&lt;span style=""&gt;      &lt;/span&gt;EXCEPTION HANDLING&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;1). What is Exception?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="color: black;"&gt;An exception is an abnormal condition that arises on programming code at run time. An exception is a run time error. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;2). What is java Exception?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span style="color: black;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;A java Exception is an object that describes an exceptional condition that has occurred in a piece of code. When an exceptional condition arises, an object representing that exception is created and thrown to the method that caused error. That method may choose to handle the exception itself or pass to on.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;3). How many ways the java exception occurred?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p style="text-align: justify;"&gt;&lt;span style="color: black;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;There are two ways.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span style="color: black;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;1). Java run-time system. 2). Manually generated by programming code.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;4). What does java run-time system exception means?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span style="color: black;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;Exception thrown by java relate to fundamental errors that violate the rules of the java language. Java run-time system exception are automatically thrown by the java run-time system.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;5). What does manually generated exception?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span style="color: black;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;Manually generated exceptions are used to report some error condition to the caller of a method. To manually throw an exception, use keyword throw.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;6). How does java exception managed or handled?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span style="color: black;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;Java exception handling is managed via five keywords: try, catch, and throw, throws, finally.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;7). How does exception handling work?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p style="text-align: justify;"&gt;&lt;span style="color: black;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;Program statements that monitor for exception are contained within a try block. If an exception occurs within the try block, it is thrown. The catch clause can catch this exception and handle the exception.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: solid none; border-color: windowtext -moz-use-text-color; border-width: 0.75pt medium; padding: 1pt 0in;"&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;Note:&lt;span style=""&gt;   &lt;/span&gt;all exception types are subclasses of built-in class Throwable.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;8). What is uncaught exception?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="color: black;"&gt;Any exception is not caught by program will be processed by the default handler. The default handler displays a string that describes the exception, print stack trace and terminates the program. &lt;b&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;9) What is stack trace?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span style="color: black;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;The stack trace will show the sequence of method invocation that led up to the error.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p style="text-align: justify;"&gt;&lt;span style="color: black;"&gt;1&lt;b&gt;0) Although java run-time systems handle exception, why we use try and catch?&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-align: justify;"&gt;&lt;span style="color: black;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;Two benefits:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span style="color: black;"&gt;&lt;span style=""&gt;                        &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;1). It allows to fix error. 2). It prevents the program from automatically terminating.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;11). Why we use multiple catch clauses for single statement?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span style="color: black;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;In some cases, more than one exception can be raised by a single piece of code. To handle this type of exception, you can specify two or more catch clauses, each catch have different type of exception. When an exception is thrown, each catch statement is inspected in order and the first one whose type matches that of the exception is executed. After one catch statement excutes, the others are bypassed, and execution continues after the try/catch block.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;12). What is nested try statement?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span style="color: black;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;The try statement can be nested. A try statement can be inside the block of another try. Each time a try statement is entered, the context of that exception is pushed on the stack. If an inner try statement does not have a catch handler for a particular exception, the stack is unwound and the next try statement’s catch handlers are inspected for a match. This continues until one of the catch statements succeeds, or the java run-time system will handle the exception.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;13). What is throwing an Exception?.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;The act of passing an Exception Object to the runtime system is called Throwing an Exception.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;14) What is the use of throw statement?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="color: black;"&gt;It is possible to throw an exception explicitly using throw statement.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: solid none; border-color: windowtext -moz-use-text-color; border-width: 0.75pt medium; padding: 1pt 0in;"&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;15) What is the use of throws statement?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span style="color: black;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;If a method is capable of causing an exception that it does not handle, it must specify this behavior so that the callers of the method can guard themselves against that exception. We do this by using throws clause in method’s declaration. The throws clause lists the types of exceptions that a method might throw. This is necessary for all exception except the type Error or Runtime Exception or their subclasses. All exception that a method can throw must be declared in the throws clause. If they are not, the compile time error will result.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;16). What is the unchecked exception?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span style="color: black;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;An unchecked exception need not be included in any method’s throws list. Because the compiler dose not check if a method handles or throws these exceptions.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;17). What is the checked exception?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span style="color: black;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;A checked exception included in method’s declaration if the method can generated one of these exceptions and does not handle it itself.&lt;span style=""&gt;              &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;18). What is chained exception?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="color: black;"&gt;The chained exception features allow to associate another exception with an exception. The second exception describes the cause of the first exception.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p&gt;&lt;b&gt;&lt;span style="color: black;"&gt;19) What is NullPointerException and how to handle it? &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p style="border: medium none ; padding: 0in;"&gt;&lt;span class="answers1"&gt;&lt;span style=""&gt;When an object is not initialized, the default value is null. When the following things happen, the NullPointerException is thrown: &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="answers1"&gt;&lt;span style=""&gt;--Calling the instance method of a null object.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="answers1"&gt;&lt;span style=""&gt;--Accessing or modifying the field of a null object.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="answers1"&gt;&lt;span style=""&gt;--Taking the length of a null as if it were an array.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="answers1"&gt;&lt;span style=""&gt;--Accessing or modifying the slots of null as if it were an array.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="answers1"&gt;&lt;span style=""&gt;--Throwing null as if it were a Throwable value.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="answers1"&gt;&lt;span style=""&gt;The NullPointerException is a runtime exception. The best practice is to catch such exception even if it is not required by language design. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;20). What is the purpose of the finally clause of a try-catch-finally statement? &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style=""&gt;         &lt;/span&gt;&lt;span class="answers"&gt;The finally clause is used to provide the capability to execute code no matter whether or not an exception is thrown or caught. &lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: solid none; border-color: windowtext -moz-use-text-color; border-width: 0.75pt medium; padding: 1pt 0in;"&gt;  &lt;p style="border: medium none ; padding: 0in;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;21) What classes of exceptions may be caught by a catch clause? &lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;A catch clause can catch any exception that may be assigned to the Throwable type. This includes the Error and Exception types. &lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;22) What is the difference between throw and throws keywords? &lt;/b&gt;&lt;br /&gt;The throw keyword denotes a statement that causes an exception to be initiated. It takes the Exception object to be thrown as argument. The exception will be caught by an immediately encompassing try-catch construction or propagated further up the calling hierarchy.&lt;br /&gt;The throws keyword is a modifier of a method that designates that exceptions may come out of the method, either by virtue of the method throwing the exception itself or because it fails to catch such exceptions that a method it calls may throw.&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;23) Does the code in finally block get executed if there is an exception and a return statement in a catch block? &lt;/b&gt;&lt;br /&gt;If an exception occurs and there is a return statement in catch block, the finally block is still executed. The finally block will not be executed when the System.exit(1) statement is executed earlier or the system shut down earlier or the memory is used up earlier before the thread goes to finally block.&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;24)When is the ArrayStoreException thrown? &lt;/b&gt;&lt;br /&gt;&lt;span class="answers"&gt;When copying elements between different arrays, if the source or destination arguments are not arrays or their types are not compatible, an ArrayStoreException will be thrown. &lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;25) WHEN IS THE ArithmeticException thrown? &lt;/b&gt;&lt;br /&gt;&lt;span class="answers"&gt;The ArithmeticException is thrown when integer is divided by zero or taking the remainder of a number by zero. It is never thrown in floating-point operations. &lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;26)What is the catch or declare rule for method declarations? &lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;If a checked exception may be thrown within the body of a method, the method must either catch the exception or declare it in its throws clause. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;27)Can an exception be rethrown? &lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;span class="answers"&gt;Yes, an exception can be rethrown. &lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: solid none; border-color: windowtext -moz-use-text-color; border-width: 0.75pt medium; padding: 1pt 0in;"&gt;  &lt;p style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;28)What happens if an exception is not caught? &lt;/b&gt;&lt;br /&gt;&lt;span class="answers"&gt;An uncaught exception results in the uncaughtException() method of the thread's ThreadGroup being invoked, which eventually results in the termination of the program in which it is thrown. &lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;29)Which arithmetic operations can result in the throwing of an ArithmeticException? &lt;/b&gt;&lt;br /&gt;&lt;span class="answers"&gt;Integer / and % can result in the throwing of an ArithmeticException.&lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;30)What happens if a try-catch-finally statement does not have a catch clause to handle an exception that is thrown within the body of the try statement? &lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;The exception propagates up to the next higher level try-catch statement (if any) or results in the program's termination. &lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;31)&lt;/b&gt;&lt;/span&gt;&lt;b&gt;What happens if an exception is not caught? &lt;/b&gt;&lt;br /&gt;&lt;span class="answers"&gt;An uncaught exception results in the uncaughtException() method of the thread's ThreadGroup being invoked, which eventually results in the termination of the program in which it is thrown. &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;32)How does a try statement determine which catch clause should be used to handle an exception? &lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;When an exception is thrown within the body of a try statement, the catch clauses of the try statement are examined in the order in which they appear. The first catch clause that is capable of handling the exception is executed. The remaining catch clauses are ignored.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;33) Explain the user defined Exceptions? &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;span class="answers"&gt;User defined Exceptions are the separate Exception classes defined by the user for specific purposed. An user defined can create by simply sub-classing it to the Exception class. This allows custom exceptions to be generated (using throw) and caught in the same way as normal exceptions. &lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;Example:&lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;class myCustomException extends Exception {&lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;// The class simply has to exist to be an exception &lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;} &lt;/span&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;34) What are checked exceptions? &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;span class="answers"&gt;Checked exceptions are those that the Java compiler forces you to catch. e.g. IOException are checked Exceptions. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="answers"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;----------------------------------------------------------------------------------------------------------------------&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;35) What are runtime exceptions? &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;span class="answers"&gt;Runtime exceptions are those exceptions that are thrown at runtime because of either wrong input data or because of wrong business logic etc. These are not checked by the compiler at compile time.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span class="answers"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;div style="border-style: solid none; border-color: windowtext -moz-use-text-color; border-width: 0.75pt medium; padding: 1pt 0in;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;36) What is the difference between error and an exception? &lt;/b&gt;&lt;/span&gt;&lt;br /&gt; &lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br /&gt; &lt;!--[endif]--&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span class="answers"&gt;An error is an irrecoverable condition occurring at runtime. Such as OutOfMemory error. These JVM errors and you can not repair them at runtime. While exceptions are conditions that occur because of bad input etc. e.g. FileNotFoundException will be thrown if the specified file does not exist. Or a NullPointerException will take place if you try using a null reference. In most of the cases it is possible to recover from an exception (probably by giving user a feedback for entering proper values etc.). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;37) How to create custom exceptions? &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;br /&gt;&lt;span class="answers"&gt;Your class should extend class Exception. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span class="answers"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;38) If I want an object of my class to be thrown as an exception object, what should I do? &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;span class="answers"&gt;The class should extend from Exception class. Or you can extend your class from some more precise exception type also. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="answers"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: solid none; border-color: windowtext -moz-use-text-color; border-width: 0.75pt medium; padding: 1pt 0in;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;39) If my class already extends from some other class what should I do if I want an instance of my class to be thrown as an exception object? &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span class="answers"&gt;&lt;br /&gt;One cannot do anything in this scenario. Because Java does not allow multiple inheritance and does not provide any exception interface as well. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span class="answers"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span class="answers"&gt;---------------------------------------------------------------------------------------------------------&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span class="answers"&gt;&lt;b&gt;40).&lt;/b&gt;&lt;/span&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt; How does an exception permeate through the code? &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;br /&gt;&lt;span class="answers"&gt;An unhandled exception moves up the method stack in search of a matching When an exception is thrown from a code which is wrapped in a try block followed by one or more catch blocks, a search is made for matching catch block. If a matching type is found then that block will be invoked. If a matching type is not found then the exception moves up the method stack and reaches the caller method. Same procedure is repeated if the caller method is included in a try catch block. This process continues until a catch block handling the appropriate type of exception is found. If it does not find such a block then finally the program terminates. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;----------------------------------------------------------------------------------------------------------&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;41) What are the different ways to handle exceptions? &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;br /&gt;&lt;span class="answers"&gt;There are two ways to handle exceptions,&lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;1. By wrapping the desired code in a try block followed by a catch block to catch the exceptions. and&lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;2. List the desired exceptions in the throws clause of the method and let the caller of the method handle those exceptions. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;42) What is the basic difference between the 2 approaches to exception handling.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;1. Try catch block and&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;2. Specifying the candidate exceptions in the throws clause?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;When should you use which approach? &lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;In the first approach as a programmer of the method, you yourself are dealing with the exception. This is fine if you are in a best position to decide should be done in case of an exception. Whereas if it is not the responsibility of the method to deal with it's own exceptions, then do not use this approach. In this case use the second approach. In the second approach we are forcing the caller of the method to catch the exceptions, that the method is likely to throw. This is often the approach library creators use. They list the exception in the throws clause and we must catch them. You will find the same approach throughout the java libraries we use.&lt;/span&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;43) Is it necessary that a catch block must follow each try block?&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;br /&gt;&lt;span class="answers"&gt;It is not necessary that a catch block must follow each try block. It should be followed by either a catch block OR a finally block. And whatever exceptions are likely to be thrown should be declared in the throws clause of the method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;--------------------------------------------------------------------------------&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;44) If I write return at the end of the try block, will the finally block still execute? &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;br /&gt;&lt;span class="answers"&gt;Yes even if you write return as the last statement in the try block and no exception occurs, the finally block will execute. The finally block will execute and then the control return. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span class="answers"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;45) If I write System.exit (0); at the end of the try block, will the finally block still execute? &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;span class="answers"&gt;No in this case the finally block will not execute because when you say System.exit (0); the control immediately goes out of the program, and thus finally never executes. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span class="answers"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;46) How does a try statement determine which catch clause should be used to handle an exception? &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;span class="answers"&gt;When an exception is thrown within the body of a try statement, the catch clauses of the try statement are examined in the order in which they appear. The first catch clause that is capable of handling the exceptionis executed. The remaining catch clauses are ignored. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="answers"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;--------------------------------------------------------------------------------&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;47) What is the catch or declare rule for method declarations? &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;br /&gt;&lt;span class="answers"&gt;If a checked exception may be thrown within the body of a method, the method must either catch the exception or declare it in its throws clause.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;48) Which package contains exception handling related classes?&lt;/b&gt;&lt;br /&gt;     java.lang&lt;br /&gt;------------------------------------------------------------------------------------------------------------&lt;br /&gt; &lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br /&gt; &lt;!--[endif]--&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;49&lt;b&gt;) What are the two types of Exceptions? &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;br /&gt;     Checked Exceptions and Unchecked Exceptions.&lt;br /&gt;------------------------------------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;br /&gt;50&lt;b&gt;) What is the base class of all exceptions? &lt;/b&gt;&lt;br /&gt;     java.lang.Throwable&lt;br /&gt;------------------------------------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;br /&gt;51&lt;b&gt;) What is the difference between Exception and Error in java? &lt;/b&gt;&lt;br /&gt;     Exception and Error are the subclasses of the Throwable class. Exception class is used for exceptional conditions that user program should catch. Error defines exceptions that are not excepted to be caught by the user program. Example is Stack Overflow.&lt;br /&gt;&lt;br /&gt;------------------------------------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;52) What is the difference between throw and throws? &lt;/b&gt;&lt;br /&gt;     throw is used to explicitly raise a exception within the program, the statement would be throw new Exception(); throws clause is used to indicate the exceptions that are not handled by the method. It must specify this behavior so the callers of the method can guard against the exceptions. throws is specified in the method signature. If multiple exceptions are not handled, then they are separated by a comma. the statement would be as follows: public void doSomething() throws IOException,MyException{}&lt;br /&gt;------------------------------------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;b&gt;53) Differentiate between Checked Exceptions and Unchecked Exceptions? &lt;/b&gt;&lt;br /&gt;     Checked Exceptions are those exceptions which should be explicitly handled by the calling method. Unhandled checked exceptions results in compilation error.&lt;br /&gt;&lt;br /&gt;Unchecked Exceptions are those which occur at runtime and need not be explicitly handled. RuntimeException and it's subclasses, Error and it's subclasses fall under unchecked exceptions.&lt;br /&gt;------------------------------------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;b&gt;54) What are User defined Exceptions? &lt;/b&gt;&lt;br /&gt;     Apart from the exceptions already defined in Java package libraries, user can define his own exception classes by extending Exception class.&lt;br /&gt;------------------------------------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;55) What is the importance of finally block in exception handling? &lt;/b&gt;&lt;br /&gt;     Finally block will be executed whether or not an exception is thrown. If an exception is thrown, the finally block will execute even if no catch statement match the exception. Any time a method is about to return to the caller from inside try/catch block, via an uncaught exception or an explicit return statement, the finally block will be executed. Finally is used to free up resources like database connections, IO handles, etc.&lt;br /&gt;------------------------------------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;b&gt;56) Can a catch block exist without a try block? &lt;/b&gt;&lt;br /&gt;     No. A catch block should always go with a try block.&lt;br /&gt;------------------------------------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;b&gt;57) Can a finally block exist with a try block but without a catch? &lt;/b&gt;&lt;br /&gt;     Yes. The following are the combinations try/catch or try/catch/finally or try/finally.&lt;br /&gt;------------------------------------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;b&gt;58) What will happen to the Exception object after exception handling? &lt;/b&gt;&lt;br /&gt;     Exception object will be garbage collected.&lt;br /&gt;------------------------------------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;b&gt;59) The subclass exception should precede the base class exception when used within the catch clause. True/False? &lt;/b&gt;&lt;br /&gt;     True.&lt;br /&gt;------------------------------------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;br /&gt;60&lt;b&gt;) Exceptions can be caught or rethrown to a calling method. True/False? &lt;/b&gt;&lt;br /&gt;     True.&lt;br /&gt;------------------------------------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;br /&gt;61&lt;b&gt;) The statements following the throw keyword in a program are not executed. True/False? &lt;/b&gt;&lt;br /&gt;     True.&lt;br /&gt;------------------------------------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;b&gt;62) How does finally block differ from finalize() method? &lt;/b&gt;&lt;br /&gt;     Finally block will be executed whether or not an exception is thrown. So it is used to free resoources. finalize() is a protected method in the Object class which is called by the JVM just before an object is garbage collected.&lt;br /&gt;------------------------------------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;br /&gt;63&lt;b&gt;) What are the constraints imposed by overriding on exception handling? &lt;/b&gt;&lt;br /&gt;     An overriding method in a subclass may only throw exceptions declared in the parent class or children of the exceptions declared in the parent class.&lt;br /&gt;------------------------------------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;64). If we don’t use exception handling what will happen?&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;            &lt;/span&gt;If we don’t use exception handling, the exception is caught by the default handler provided by java run-time system.&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;65). What are the types of error?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                        &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;There are two type of error.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;1). Compile-time error.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;            &lt;/span&gt;2). Run-time error.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;------------------------------------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;66). What is compile time error?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;All syntax error will be detected and displayed by java compiler. So they are compile time error.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;If the compiler display error, it will not create .class file.&lt;span style=""&gt;          &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                        &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;------------------------------------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;67). What is run time error?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;The program may compile successfully and create&lt;span style=""&gt;  &lt;/span&gt;.class file but may not run properly. Such a program may produce wrong result or terminate program. Exam is stack overflow.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;------------------------------------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: -0.75in;"&gt;&lt;span style=""&gt;      &lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8329086772546213543-2003224704265875664?l=stepintofuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stepintofuture.blogspot.com/feeds/2003224704265875664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8329086772546213543&amp;postID=2003224704265875664' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8329086772546213543/posts/default/2003224704265875664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8329086772546213543/posts/default/2003224704265875664'/><link rel='alternate' type='text/html' href='http://stepintofuture.blogspot.com/2008/07/java-exception-handling.html' title='JAVA-EXCEPTION HANDLING'/><author><name>sureshkumar</name><uri>http://www.blogger.com/profile/07546589267927657994</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8329086772546213543.post-4894462703220502891</id><published>2008-07-17T16:51:00.000-07:00</published><updated>2008-07-24T18:54:20.935-07:00</updated><title type='text'>JAVA-MULTI THREADING</title><content type='html'>&lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-size: 16pt;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-size: 16pt;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;MULTI-THREADED PROGRAMMING&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span style=""&gt;1)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style=""&gt;What is the difference between process and thread? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="margin-left: 0.25in; text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;  &lt;/span&gt;Process is a program in execution whereas thread is a separate path of execution in a program.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;2) What is multithreading and what are the methods for inter-thread communication and what is the class in which these methods are defined?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;  &lt;/span&gt;Multithreading is the mechanism in which more than one thread run independent of each other within the process.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;         &lt;/span&gt;wait (), notify () and notifyAll () methods can be used for inter-thread communication and these methods are in Object class. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;         &lt;/span&gt;wait( ) : When a thread executes a call to wait( ) method, it surrenders the object lock and enters into a waiting state.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;         &lt;/span&gt;notify( ) or notifyAll( ) : To remove a thread from the waiting state, some other thread must make a call to&lt;span style=""&gt;  &lt;/span&gt;notify( ) or notifyAll( ) method on the same object.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;3) What is the class and interface in java to create thread and which is the most advantageous method?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;  &lt;/span&gt;Thread class and Runnable interface can be used to create threads and using Runnable interface is the most advantageous method to create threads because we need not extend thread class here. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;4) What are the states associated in the thread?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;  &lt;/span&gt;Thread contains ready, running, waiting and dead states.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style=""&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;5) What is synchronization?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;  &lt;/span&gt;Synchronization is the mechanism that ensures that only one thread is accessed the resources at a time.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;6) When you will synchronize a piece of your code?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;  &lt;/span&gt;When you expect different threads will access your code and these threads may change a particular data causing data corruption.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style=""&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;7) What is deadlock?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;  &lt;/span&gt;When two threads are waiting each other and can't precede the program is said to be deadlock.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;8) What are daemon thread and which method is used to create the daemon thread?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;  &lt;/span&gt;Daemon thread is a low priority thread which runs intermittently in the back ground doing the garbage collection operation for the java runtime system. setDaemon method is used to create a daemon thread.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;9). What are the disadvantages of using threads?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="margin-left: 0.5in; text-indent: 0.5in;"&gt;&lt;span style=""&gt;DeadLock&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;10).&lt;/b&gt;&lt;b&gt;&lt;span style=""&gt;What are mutex and semaphore? What is the difference between them?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;A mutex is a synchronization object that allows only one process or thread to access a critical code block. A semaphore on the other hand allows one or more processes or threads to access a critical code block. A semaphore is a multiple mutex.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;11). Describe synchronization in respect to multithreading.?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchonization, it is possible for one thread to modify a shared variable while another thread is in the process of using or updating same shared variable. This usually leads to significant errors.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;12) What are synchronized methods and synchronized statements? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;      &lt;/span&gt;Synchronized methods are methods that are used to control access to an object. A thread only executes a synchronized method after it has acquired the lock for the method's object or class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;      &lt;/span&gt;Synchronized statements are similar to synchronized methods. A synchronized statement can only be executed after a thread has acquired the lock for the object or class referenced in the synchronized statement. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;13). What are three ways in which a thread can enter the waiting state? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;      &lt;/span&gt;A thread can enter the waiting state by invoking its sleep () method, by blocking on I/O, by unsuccessfully attempting to acquire an object's lock, or by invoking an object's wait () method. It can also enter the waiting state by invoking its (deprecated) suspend () method. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;14). In a lock be acquired on a class? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;      &lt;/span&gt;Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;15). What's new with the stop(), suspend() and resume() methods in JDK 1.2? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;      &lt;/span&gt;The stop(), suspend() and resume() methods have been deprecated in JDK 1.2. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;16). What state does a thread enter when it terminates its processing? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;      &lt;/span&gt;When a thread terminates it’s processing, it enters the dead state. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;17). What is the difference between yielding and sleeping? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-align: justify;"&gt;&lt;span class="answers1"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;When a task invokes its yield() method, it returns to the ready state.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p style="border: medium none ; padding: 0in; margin-left: 0.5in; text-align: justify;"&gt;&lt;span class="answers1"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;When a task invokes its sleep() method, it returns to the waiting state. &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;18). What is the difference between preemptive scheduling and time slicing? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style=""&gt;&lt;span style=""&gt;      &lt;/span&gt;&lt;b&gt;Under preemptive scheduling&lt;/b&gt;, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;Under time slicing,&lt;/span&gt;&lt;/b&gt;&lt;span style=""&gt; a task executes for a predefined slice of time and then reenters the pool of ready tasks.&lt;span style=""&gt;  &lt;/span&gt;The scheduler then determines which task should execute next, based on priority and other factors. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;19). Can an anonymous class be declared as implementing an interface and extending a class? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;      &lt;/span&gt;An anonymous class may implement an interface or extend a superclass, but may not be declared to do both. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;20). What invokes a thread's run () method? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;      &lt;/span&gt;After a thread is started via its start () method or that of the Thread class, the JVM invokes the thread's run () method when the thread is initially executed. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;21). What is the purpose of the wait(), notify(), and notifyAll() methods? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;      &lt;/span&gt;The wait(),notify(), and notifyAll() methods are used to provide an efficient way for threads to communicate each other. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;22). What are the high-level thread states? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;      &lt;/span&gt;The high-level thread states are ready, running, waiting, and dead. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;23) How does multithreading take place on a computer with a single CPU? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="text-align: justify; text-indent: 0.5in;"&gt;&lt;span style=""&gt;The operating system's task scheduler allocates execution time to multiple tasks. By quickly switching between executing tasks, it creates the impression that tasks execute sequentially. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;24). What is a thread?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style=""&gt;It’s a single sequential stream of execution.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="forquestionsblue1"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="answers1"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;A thread is an independent path of execution in a system. &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;25). What is runnable?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style=""&gt;It’s an Interface through which Java implements Threads. The class can extend from any class but if it implements Runnable, Threads can be used in that particular application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;26). What are the various thread priorities?.&lt;/span&gt;&lt;/b&gt;&lt;span style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style=""&gt;(i)&lt;span style=""&gt;  &lt;/span&gt;Min-Priority-value(1).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style=""&gt;(ii) Normal-Priority-value(5).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style=""&gt;(iii)Max-Priority-value(10).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;27).What is Inter-Thread communication?.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style=""&gt;To exchange information between two threads.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: solid none; border-color: windowtext -moz-use-text-color; border-width: 0.75pt medium; padding: 1pt 0in;"&gt;  &lt;p style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;28) What do you understand by Synchronization? &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;span class="answers1"&gt;&lt;span style=""&gt;Synchronization is a process of controlling the access of shared resources by the multiple threads in such a manner that only one thread can access one resource at a time. In non synchronized multithreaded application, it is possible for one thread to modify a shared object while another thread is in the process of using or updating the object's value.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="answers1"&gt;&lt;span style=""&gt;Synchronization prevents such type of data corruption.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="answers1"&gt;&lt;span style=""&gt;E.g. Synchronizing a function:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="answers1"&gt;&lt;span style=""&gt;public synchronized void Method1 () {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="answers1"&gt;&lt;span style=""&gt;// Appropriate method-related code. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;&lt;span class="answers1"&gt;&lt;span style=""&gt;E.g. Synchronizing a block of code inside a function:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="answers1"&gt;&lt;span style=""&gt;public myFunction (){&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="answers1"&gt;&lt;span style=""&gt;synchronized (this) { &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="answers1"&gt;&lt;span style=""&gt;// Synchronized code here.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;29) What is multi-threading? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="answers1"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;Multi-threading means various threads that run in a system. &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: solid none; border-color: windowtext -moz-use-text-color; border-width: 0.75pt medium; padding: 1pt 0in;"&gt;  &lt;p style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;34) How to create a thread in a program? &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;span class="answers1"&gt;&lt;span style=""&gt;You have two ways to do so. First, making your class "extends" Thread class. Second, making your class "implements" Runnable interface. Put jobs in a run() method and call start() method to start the thread. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;35) Can Java object be locked down for exclusive use by a given thread?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="answers1"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;Yes. You can lock an object by putting it in a "synchronized" block. The locked object is inaccessible to any thread other than the one that explicitly claimed it. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in;"&gt;&lt;span class="forquestionsblue1"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;36) Can each Java object keep track of all the threads that want to exclusively access to it?&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;span class="answers1"&gt;&lt;span style=""&gt;Yes. Use Thread.currentThread() method to track the accessing thread. &lt;/span&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;37&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;)&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt; What happens when a thread cannot acquire a lock on an object? &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;span class="answers1"&gt;&lt;span style=""&gt;If a thread attempts to execute a synchronized method or synchronized statement and is unable to acquire an object's lock, it enters the waiting state until the lock becomes available. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;38) What is the difference between Process and Thread? &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;span class="answers1"&gt;&lt;span style=""&gt;A process can contain multiple threads. In most multithreading operating systems, a process gets its own memory address space; a thread doesn't. Threads typically share the heap belonging to their parent process. For instance, a JVM runs in a single process in the host O/S. Threads in the JVM share the heap belonging to that process; that's why several threads may access the same object. Typically, even though they share a common heap, threads have their own stack space. This is how one thread's invocation of a method is kept separate from another's. This is all a gross oversimplification, but it's accurate enough at a high level. Lots of details differ between operating systems. Process vs. Thread A program vs. similar to a sequential program an run on its own vs. Cannot run on its own Unit of allocation vs. Unit of execution Have its own memory space vs. Share with others Each process has one or more threads vs. Each thread belongs to one process Expensive, need to context switch vs. Cheap, can use process memory and may not need to context switch More secure. One process cannot corrupt another process vs. Less secure. A thread can write the memory used by another thread &lt;/span&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;39)Two methods have key words static synchronized and synchronized separately. What is the difference between them? &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;span class="answers"&gt;Both are synchronized methods. One is instance method, the other is class method. Method with static modifier is a class method. That means the method belongs to class itself and can be accessed directly with class name and is also called Singleton design. The method without static modifier is an instance method. That means the instance method belongs to its object. Every instance of the class gets its own copy of its instance method. &lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;When synchronized is used with a static method, a lock for the entire class is obtained. When synchronized is used with a non-static method, a lock for the particular object (that means instance) of the class is obtained. &lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;Since both methods are synchronized methods, you are not asked to explain what is a synchronized method. You are asked to tell the difference between instance and class method. Of course, your explanation to how synchronized keyword works doesn't hurt. And you may use this opportunity to show your knowledge scope. &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;40)What's the difference between the methods sleep() and wait() &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;span class="answers"&gt;The code sleep(1000); puts thread aside for exactly one second. The code wait(1000), causes a wait of up to one second. A thread could stop waiting earlier if it receives the notify() or notifyAll() call. The method wait() is defined in the class Object and the method sleep() is defined in the class Thread.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;41) Why do threads block on I/O? &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;span class="answers"&gt;Threads block on I/O (that is enters the waiting state) so that other threads may execute while the I/O Operation is performed. &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;42)When a thread blocks on I/O, what state does it enter? &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;span class="answers"&gt;A thread enters the waiting state when it blocks on I/O. &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;43)When a thread is created and started, what is its initial state? &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;A thread is in the ready state after it has been created and started.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;44)What is the purpose of the wait(), notify(), and notifyAll() methods? &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;span class="answers"&gt;The wait(),notify(), and notifyAll() methods are used to provide an efficient way for threads to wait for a shared resource. When a thread executes an object's wait() method, it enters the waiting state. It only enters the ready state after another thread invokes the object's notify() or notifyAll() methods.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;45)What are the high-level thread states? &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;span class="answers"&gt;The high-level thread states are ready, running, waiting, and dead.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;46)What is an object's lock and which objects have locks?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="answers"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;An object's lock is a mechanism that is used by multiple threads to obtain synchronized access to the object. A thread may execute a synchronized method of an object only after it has acquired the object's lock. All objects and classes have locks. A class's lock is acquired on the class's Class object. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span class="answers"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;47)&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; What happens when a thread cannot acquire a lock on an object? &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;span class="answers"&gt;If a thread attempts to execute a synchronized method or synchronized statement and is unable to acquire an object's lock, it enters the waiting state until the lock becomes available. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p&gt;&lt;span class="answers"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;48)&lt;/span&gt;&lt;/span&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; What happens when you invoke a thread's interrupt method while it is sleeping or waiting? &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;span class="answers"&gt;When a task's interrupt() method is executed, the task enters the ready state. The next time the task enters the running state, an InterruptedException is thrown. &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: solid none; border-color: windowtext -moz-use-text-color; border-width: 0.75pt medium; padding: 1pt 0in;"&gt;  &lt;p style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;48)What state is a thread in when it is executing?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="answers"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;An executing thread is in the running state. &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;49)How can a dead thread be restarted? &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;span class="answers"&gt;A dead thread cannot be restarted. &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;50)What method must be implemented by all threads? &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;span class="answers"&gt;All tasks must implement the run() method, whether they are a subclass of Thread or implement the Runnable interface. &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;51)What are the different identifier states of a Thread? &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;span class="answers"&gt;The different identifiers of a Thread are:&lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;R - Running or runnable thread&lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;S - Suspended thread&lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;CW - Thread waiting on a condition variable&lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;MW - Thread waiting on a monitor lock&lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;MS - Thread suspended waiting on a monitor lock&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;52)What is the difference between notify() and notifyAll()? &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;span class="answers"&gt;notify() is used to unblock one waiting thread; notifyAll() is used to unblock all of them. Using notify() is preferable (for efficiency) when only one blocked thread can benefit from the change (for example, when freeing a buffer back into a pool). notifyAll() is necessary (for correctness) if multiple threads should resume (for example, when releasing a "writer" lock on a file might permit all "readers" to resume).&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;53)How is static Synchronization different form non-static synchronization? &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="answers"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;When Synchronization is applied on a static Member or a static block, the lock is performed on the Class and not on the Object, while in the case of a Non-static block/member, lock is applied on the Object and not on class. [Trail 2: There is a class called Class in Java whose object is associated with the object(s) of your class. All the static members declared in your class will have reference in this class(Class). As long as your class exists in memory this object of Class is also present. Thats how even if you create multiple objects of your class only one Class object is present and all your objects are linked to this Class object. Even though one of your object is GCed after some time, this object of Class is not GCed untill all the objects associated with it are GCed. &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;span class="answers"&gt;This means that when ever you call a "static synchronized" block, JVM locks access to this Class object and not any of your objects. Your client can till access the non-static members of your objects. &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;54) Why Thread is faster compare to process? &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;span class="answers"&gt;A thread is never faster than a process. If you run a thread(say there's a process which has spawned only one thread) in one JVM and a process in another and that both of them require same resources then both of them would take same time to execute. But, when a program/Application is thread based(remember here there will be multiple threads running for a single process) then definetly a thread based appliation/program is faster than a process based application. This is because, when ever a process requires or waits for a resource CPU takes it out of the critical section and allocates the mutex to another process. &lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;Before deallocating the ealier one, it stores the context(till what state did it execute that process) in registers. Now if this deallocated process has to come back and execute as it has got the resource for which it was waiting, then it can't go into critical section directly. CPU asks that process to follow scheduling algorithm. So this process has to wait again for its turn. While in the case of thread based application, the application is still with CPU only that thread which requires some resource goes out, but its co threads(of same process/apllication) are still in the critical section. Hence it directly comes back to the CPU and does not wait outside. Hence an application which is thread based is faster than an application which is process based. &lt;/span&gt;&lt;br /&gt;&lt;span class="answers"&gt;Be sure that its not the competion between thread and process, its between an application which is thread based or process based. &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;55) Explain different way of using thread?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="answers"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;The thread could be implemented by using runnable interface or by inheriting from the Thread class. The former is more advantageous, 'cause when you are going for multiple inheritances. The only interface can help. &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;56) What method must be implemented by all threads? &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;span class="answers"&gt;All tasks must implement the run() method, whether they are a subclass of Thread or implement the Runnable interface.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;57) What is more advisable to create a thread, by implementing a Runnable interface or by extending Thread class?&lt;br /&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="answers1"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;Strategically speaking, threads created by implementing Runnable interface are more advisable. If you create a thread by extending a thread class, you cannot extend any other class. If you create a thread by implementing Runnable interface, you save a space for your class to extend another class now or in future. &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;&lt;span style=""&gt;58). Garbage collector thread belongs to which priority?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;59). What is the method to find if a thread is active or not?&lt;/span&gt;&lt;/b&gt;&lt;span style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p style="text-align: justify;"&gt;&lt;span class="forquestionsblue"&gt;&lt;b&gt;60) What is the difference between notify() and notifyAll()? &lt;/b&gt;&lt;/span&gt;&lt;br /&gt;A &lt;span class="answers"&gt;notify() is used to unblock one waiting thread; notifyAll() is used to unblock all of them. Using notify() is preferable (for efficiency) when only one blocked thread can benefit from the change (for example, when freeing a buffer back into a pool). notifyAll() is necessary (for correctness) if multiple threads should resume (for example, when releasing a "writer" lock on a file might permit all "readers" to resume).&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoPlainText" style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;span style=""&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h1&gt;Some basic question&lt;/h1&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;1) What are the two types of multitasking ? &lt;/b&gt;&lt;br /&gt;     a. Process-based.&lt;br /&gt;&lt;span style=""&gt;     &lt;/span&gt;b. Thread-based.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2) What is a Thread? &lt;/b&gt;&lt;br /&gt;     A thread is a single sequential flow of control within a program.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;3) What are the two ways to create a new thread? &lt;/b&gt;&lt;br /&gt;     a.Extend the Thread class and override the run() method.&lt;br /&gt;b.Implement the Runnable interface and implement the run() method.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;4) If you have ABC class that must subclass XYZ class, which option will you use to create a thread? &lt;/b&gt;&lt;br /&gt;     I will make ABC implement the Runnable interface to create a new thread, because ABC class will not be able to extend both XYZ class and Thread class.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;5) Which package contains Thread class and Runnable Interface? &lt;/b&gt;&lt;br /&gt;     java.lang package&lt;br /&gt;&lt;br /&gt;&lt;b&gt;6) What is the signature of the run() mehod in the Thread class? &lt;/b&gt;&lt;br /&gt;     public void run()&lt;br /&gt;&lt;br /&gt;&lt;b&gt;7) Which methods calls the run() method? &lt;/b&gt;&lt;br /&gt;     start() method.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;8) Which interface does the Thread class implement? &lt;/b&gt;&lt;br /&gt;     Runnable interface&lt;br /&gt;&lt;br /&gt;&lt;b&gt;9) What are the states of a Thread ? &lt;/b&gt;&lt;br /&gt;     Ready,Running,Waiting and Dead.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;10) Where does the support for threading lie? &lt;/b&gt;&lt;br /&gt;     The thread support lies in java.lang.Thread, java.lang.Object and JVM.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;11) In which class would you find the methods sleep() and yield()? &lt;/b&gt;&lt;br /&gt;     Thread class &lt;br /&gt; &lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br /&gt; &lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;12) In which class would you find the methods notify(),notifyAll() and wait()? &lt;/b&gt;&lt;br /&gt;     Object class&lt;br /&gt;&lt;br /&gt;&lt;b&gt;13) What will notify() method do? &lt;/b&gt;&lt;br /&gt;     notify() method moves a thread out of the waiting pool to ready state, but there is no guaranty which thread will be moved out of the pool. &lt;br /&gt; &lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br /&gt; &lt;!--[endif]--&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;b&gt;14) Can you notify a particular thread? &lt;/b&gt;&lt;br /&gt;     No.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;15) What is the difference between sleep() and yield()? &lt;/b&gt;&lt;br /&gt;     When a Thread calls the sleep() method, it will return to its waiting state. When a Thread calls the yield() method, it returns to the ready state.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;16) What is a Daemon Thread? &lt;/b&gt;&lt;br /&gt;     Daemon is a low priority thread which runs in the backgrouund.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;17) How to make a normal thread as daemon thread? &lt;/b&gt;&lt;br /&gt;     We should call setDaemon(true) method on the thread object to make a thread as daemon thread.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;18) What is the difference between normal thread and daemon thread? &lt;/b&gt;&lt;br /&gt;     Normal threads do mainstream activity, whereas daemon threads are used low priority work. Hence daemon threads are also stopped when there are no normal threads.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;19) Give one good example of a daemon thread? &lt;/b&gt;&lt;br /&gt;     Garbage Collector is a low priority daemon thread.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;20) What does the start() method of Thread do? &lt;/b&gt;&lt;br /&gt;     The thread's start() method puts the thread in ready state and makes the thread eligible to run. start() method automatically calls the run () method.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;21) What are the two ways that a code can be synchronised? &lt;/b&gt;&lt;br /&gt;     a. Method can be declared as synchronised.&lt;br /&gt;b. A block of code be sychronised.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;22) Can you declare a static method as synchronized? &lt;/b&gt;&lt;br /&gt;     Yes, we can declare static method as synchronized. But the calling thread should acquire lock on the class that owns the method.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;23) Can a thread execute another objects run() method? &lt;/b&gt;&lt;br /&gt;     A thread can execute it's own run() method or another objects run() method. &lt;br /&gt; &lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br /&gt; &lt;!--[endif]--&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;24) What is the default priority of a Thread? &lt;/b&gt;&lt;br /&gt;     NORM_PRIORITY&lt;br /&gt;&lt;br /&gt;&lt;b&gt;25) What is a deadlock? &lt;/b&gt;&lt;br /&gt;     A condition that occurs when two processes are waiting for each other to complete before proceeding. The result is that both processes wait endlessly.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;26) What are all the methods used for Inter Thread communication and what is the class in which these methods are defined? &lt;/b&gt;&lt;br /&gt;     a. wait(),notify() &amp;amp; notifyall()&lt;br /&gt;&lt;span style=""&gt;     &lt;/span&gt;b. Object class&lt;br /&gt;&lt;br /&gt;&lt;b&gt;27) What is the mechanisam defind in java for a code segment be used by only one Thread at a time? &lt;/b&gt;&lt;br /&gt;     Synchronisation&lt;br /&gt;&lt;br /&gt;&lt;b&gt;28) What is the procedure to own the moniter by many threads? &lt;/b&gt;&lt;br /&gt;     Its not possible. A monitor can be held by only one thread at a time.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;29) What is the unit for 500 in the statement, obj.sleep(500);? &lt;/b&gt;&lt;br /&gt;     500 is the no of milliseconds and the data type is long.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;30) What are the values of the following thread priority constants?&lt;br /&gt;MAX_PRIORITY,MIN_PRIORITY and NORMAL_PRIORITY&lt;br /&gt;&lt;/b&gt;     10,1,5&lt;br /&gt;&lt;br /&gt;&lt;b&gt;31) What is the default thread at the time of starting a java application? &lt;/b&gt;&lt;br /&gt;     main thread&lt;br /&gt;&lt;br /&gt;&lt;b&gt;32) The word synchronized can be used with only a method. True/ False? &lt;/b&gt;&lt;br /&gt;     False. A block of code can also be synchronised.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;33) What is a Monitor?&lt;/b&gt;&lt;br /&gt;     A monitor is an object which contains some synchronized code in it.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;34) What are all the methods defined in the Runnable Interface? &lt;/b&gt;&lt;br /&gt;     only run() method is defined the Runnable interface.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;35) How can i start a dead thread?&lt;/b&gt;&lt;br /&gt;     A dead Thread cannot be started again.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;36) When does a Thread die?&lt;/b&gt;&lt;br /&gt;     A Thread dies after completion of run() method. &lt;br /&gt; &lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br /&gt; &lt;!--[endif]--&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;b&gt;37) What does the yield() method do? &lt;/b&gt;&lt;br /&gt;     The yield() method puts currently running thread in to ready state.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;38) What exception does the wait() method throw? &lt;/b&gt;&lt;br /&gt;     The java.lang.Object class wait() method throws "InterruptedException".&lt;br /&gt;&lt;br /&gt;&lt;b&gt;39) What does notifyAll() method do? &lt;/b&gt;&lt;br /&gt;     notifyAll() method moves all waiting threads from the waiting pool to ready state.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;40) What does wait() method do? &lt;/b&gt;&lt;br /&gt;     wait() method releases CPU, releases objects lock, the thread enters into pool of&lt;span style=""&gt;   &lt;/span&gt;waiting threads. &lt;br /&gt; &lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br /&gt; &lt;!--[endif]--&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style=""&gt;41) What is semaphore?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;br /&gt;42) Can you explain how Scheduling and Priority works in threads?&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8329086772546213543-4894462703220502891?l=stepintofuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stepintofuture.blogspot.com/feeds/4894462703220502891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8329086772546213543&amp;postID=4894462703220502891' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8329086772546213543/posts/default/4894462703220502891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8329086772546213543/posts/default/4894462703220502891'/><link rel='alternate' type='text/html' href='http://stepintofuture.blogspot.com/2008/07/live-cricket-score.html' title='JAVA-MULTI THREADING'/><author><name>sureshkumar</name><uri>http://www.blogger.com/profile/07546589267927657994</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8329086772546213543.post-2506872456419382442</id><published>2008-07-17T09:10:00.000-07:00</published><updated>2008-07-24T18:47:47.217-07:00</updated><title type='text'>JAVA-UTIL PACKAGE</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;font-size:180%;" &gt;Util Collections  &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1) What is Collection &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;API&lt;/span&gt; ?    &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;            The Collection &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;API&lt;/span&gt; is a set of classes and interfaces that support operation on collections of objects. These classes and interfaces are more flexible, more powerful, and more regular than the vectors, arrays, and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;hashtables&lt;/span&gt; if effectively replaces.&lt;br /&gt;&lt;br /&gt;Example of classes: &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;HashSet&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;HashMap&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;ArrayList&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;LinkedList&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;TreeSet&lt;/span&gt; and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;TreeMap&lt;/span&gt;.&lt;br /&gt;Example of interfaces: Collection, Set, List and Map.&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2) Is Iterator a Class or Interface? What is its use?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;                   Iterator is an interface which is used to step through the elements of a Collection.&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------&lt;br /&gt;   &lt;span style="font-weight: bold;"&gt;3) What is the Vector class? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Vector class provides the capability to implement a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;growable&lt;/span&gt; array of objects.&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4) What's the main difference between a Vector and an &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;ArrayList&lt;/span&gt;? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Java Vector class is internally synchronized and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;ArrayList&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;isnot&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;5) What is the Properties class?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The properties class is a subclass of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;Hashtable&lt;/span&gt; that can be read from or written to a stream. It also provides the capability to specify a set of default values to be used.&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;6) What is the Map interface? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;         The Map interface replaces the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;JDK&lt;/span&gt; 1.1 Dictionary class and is used associate keys with values.&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;7) What are Vector, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;Hashtable&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;LinkedList&lt;/span&gt; and Enumeration?            &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Vector :&lt;/span&gt; The Vector class provides the capability to implement a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;growable&lt;/span&gt; array of objects.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;Hashtable&lt;/span&gt; : &lt;/span&gt;The &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;Hashtable&lt;/span&gt; class implements a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;Hashtable&lt;/span&gt; data structure. A &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;Hashtable&lt;/span&gt; indexes and stores objects in a dictionary using hash codes as the object's keys. Hash codes are integer values that identify objects.    &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;LinkedList&lt;/span&gt;:&lt;/span&gt; Removing or inserting elements in the middle of an array can be done using &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;LinkedList&lt;/span&gt;. A &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;LinkedList&lt;/span&gt; stores each object in a separate link whereas an array stores object references in consecutive Locations.     &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Enumeration: &lt;/span&gt;An object that implements the Enumeration interface generates a series of elements, one at a time. It has two methods, namely &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;hasMoreElements&lt;/span&gt;( ) and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;nextElement&lt;/span&gt;( ). &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;HasMoreElemnts&lt;/span&gt;( ) tests if this enumeration has more elements and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;nextElement&lt;/span&gt; method returns successive elements of the series.&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;8) What is the difference between set and list?         &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Set stores elements in an unordered way but do not contain duplicate elements, whereas   list stores elements in an ordered way but may contain duplicate elements.      &lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;9).What is the List interface?                    &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The List interface provides support for ordered collections of objects.      &lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;10). What is the Vector class?                  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Vector class provides the capability to implement a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;growable&lt;/span&gt; array of objects.      &lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;11). What is an Iterator interface?                  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Iterator interface is used to step through the elements of a Collection.         &lt;br /&gt;&lt;br /&gt;------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;12). What is the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;GregorianCalendar&lt;/span&gt; class?                  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_31"&gt;GregorianCalendar&lt;/span&gt; provides support for traditional Western calendars.         &lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;13). What is the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;SimpleTimeZone&lt;/span&gt; class?                  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;SimpleTimeZone&lt;/span&gt; class provides support for a Gregorian calendar.         &lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;14). What is the Properties class?                  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The properties class is a subclass of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;Hashtable&lt;/span&gt; that can be read from or written to a stream. It also provides the capability to specify a set of default values to be used.         &lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;15). What is the Locale class?                  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Locale class is used to tailor program output to the conventions of a particular geographic, political, or cultural region.         &lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;16). What is the Map interface?      &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Map interface replaces the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_35"&gt;JDK&lt;/span&gt; 1.1 Dictionary class and is used associate keys with values.&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;17). What is the Set interface?                 &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Set interface provides methods for accessing the elements of a finite mathematical set. Sets do not allow duplicate elements.             &lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;18).Which java.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_36"&gt;util&lt;/span&gt; classes and interfaces support event handling?                   &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_37"&gt;EventObject&lt;/span&gt; class and the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_38"&gt;EventListener&lt;/span&gt; interface support event processing.        &lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;19). What is the Dictionary class?                 &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Dictionary class provides the capability to store key-value pairs.&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;20) What's the main difference between a Vector and an &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_39"&gt;ArrayList&lt;/span&gt;? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Java Vector class is internally synchronized and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_40"&gt;ArrayList&lt;/span&gt; is not.  &lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;21)What is &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_41"&gt;HashMap&lt;/span&gt; and Map?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Map is Interface and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_42"&gt;Hashmap&lt;/span&gt; is class that implements that.   &lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;22)Difference between &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_43"&gt;HashMap&lt;/span&gt; and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_44"&gt;HashTable&lt;/span&gt;? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_45"&gt;HashMap&lt;/span&gt; class is roughly equivalent to &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_46"&gt;Hashtable&lt;/span&gt;, except that it is &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_47"&gt;unsynchronized&lt;/span&gt; and permits nulls. (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_48"&gt;HashMap&lt;/span&gt; allows null values as key and value whereas &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_49"&gt;Hashtable&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_50"&gt;doesnt&lt;/span&gt; allow). &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_51"&gt;HashMap&lt;/span&gt; does not guarantee that the order of the map will remain constant over time. &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_52"&gt;HashMap&lt;/span&gt; is &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_53"&gt;unsynchronized&lt;/span&gt; and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_54"&gt;Hashtable&lt;/span&gt; is synchronized.&lt;br /&gt;&lt;br /&gt;=====================================================================&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;                                            Some util package interview questions&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;  &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size:20;"&gt;JAVA UTIL PACKAGE(java.utl.*)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:20;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:20;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;1). What is Collection Framework?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=""&gt;            &lt;/span&gt;The Collection &lt;span class="blsp-spelling-error"&gt;API&lt;/span&gt; is a set of classes and interfaces that support operation on collections of objects. These classes and interfaces are more flexible, more powerful, and more regular than the vectors, arrays, and &lt;span class="blsp-spelling-error"&gt;hashtables&lt;/span&gt; if effectively replaces.&lt;br /&gt;&lt;br /&gt;Example of classes: &lt;span class="blsp-spelling-error"&gt;HashSet&lt;/span&gt;, &lt;span class="blsp-spelling-error"&gt;HashMap&lt;/span&gt;, &lt;span class="blsp-spelling-error"&gt;ArrayList&lt;/span&gt;, &lt;span class="blsp-spelling-error"&gt;LinkedList&lt;/span&gt;, &lt;span class="blsp-spelling-error"&gt;TreeSet&lt;/span&gt; and &lt;span class="blsp-spelling-error"&gt;TreeMap&lt;/span&gt;.&lt;br /&gt;Example of interfaces: Collection, Set, List and Map.&lt;/p&gt;  &lt;div  style="border-style: none none solid; padding: 0in 0in 1pt;color:-moz-use-text-color -moz-use-text-color windowtext;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;2). What is ResourceBundle?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;div  style="border-style: none none solid; padding: 0in 0in 1pt;color:-moz-use-text-color -moz-use-text-color windowtext;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;            &lt;/span&gt;This class aids the internationalization of large program with many locale-specific resources.&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;3). What is ListResourceBundle?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;div  style="border-style: none none solid; padding: 0in 0in 1pt;color:-moz-use-text-color -moz-use-text-color windowtext;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;            &lt;/span&gt;This class aids the internationalization of large program with many locale-specific resources.&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;4). What is PropertyResourceBundle?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;div  style="border-style: none none solid; padding: 0in 0in 1pt;color:-moz-use-text-color -moz-use-text-color windowtext;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;            &lt;/span&gt;This class aids the internationalization of large program with many locale-specific resources.&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;5). What is Property permission?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;The PropertyPermission allows you to grant a read/write permission to a system property.&lt;/p&gt;  &lt;div color="-moz-use-text-color -moz-use-text-color windowtext" style="border-style: none none solid; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;6). What are the ad hoc classes?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=""&gt;            &lt;/span&gt;Dictionary,Vector,Stack and Properties are ad hoc classes that are used to store and manipulate group of object.&lt;/p&gt;  &lt;div color="-moz-use-text-color -moz-use-text-color windowtext" style="border-style: none none solid; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;7). When is UnspportedOperationException thrown?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=""&gt;            &lt;/span&gt;If the collection cannot be modified when UnsupportedOperationException is thrown.&lt;/p&gt;  &lt;div color="-moz-use-text-color -moz-use-text-color windowtext" style="border-style: none none solid; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;8). When is ClassCastException thrown?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=""&gt;            &lt;/span&gt;A ClassCastException is generated when one object is incompatible with another object that means when attempt is made to add an incompatible object to a collection.&lt;/p&gt;  &lt;div color="-moz-use-text-color -moz-use-text-color windowtext" style="border-style: none none solid; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;9). What is list?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=""&gt;            &lt;/span&gt;The list interface extends Collection and declares the behavior of a collection that stores a sequence of elements. Elements can be inserted and accessed by their position in the list, using zero-based index. A list may contain duplicate elements.&lt;/p&gt;  &lt;div color="-moz-use-text-color -moz-use-text-color windowtext" style="border-style: none none solid; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;10). What is set?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;div color="-moz-use-text-color -moz-use-text-color windowtext" style="border-style: none none solid; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoBodyText" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;            &lt;/span&gt;The Set interface defines a set. It extends Collection and declares the behavior of a collection. It does not allowed duplicate elements. It does not define any additional methods of its own.&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;11). What is SortedSet?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;The SortedSet interface extends Set and declates the behavior of set that sorted elements in ascending order.&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;12). What is ArrayList?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;The ArrayList extends AbstractList and implements List interface. ArrayList support dynamic arrays that can grow as needed.&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;13). What is difference between Array and ArrayList?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=""&gt;            &lt;/span&gt;In java, standard array is fixed length. After array is created, we cannot increase or decrease the size of array. So we must know in advance how many elements an array will hold. But sometime, we don’t know util run time how large of array we need. To handle this situation, the collection framework defines arrayList.&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;14). What is linkedlist?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;            &lt;/span&gt;The LinkedList class extends AbstractSequentialList and implements List interface. It support linked list data structure.&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;15). What is hashSet?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;The HashSet class extends AbstractSet that implements Set interface. It creates collection that uses hash table for storage.&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;16). What is hashing?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;The hashtable stores elements by using a mechanism called hashing.&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;17). What is hashCode?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=""&gt;            &lt;/span&gt;In hashing, the informational content of key is used to determine a unique value, called hashCode.&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;18). What is LinkedHashSet?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=""&gt;            &lt;/span&gt;The LinkedHashSet extends HashSet class. This class maintains a linked list of entries in the set,in order in which they were inserted. &lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;19). What is treeset?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=""&gt;            &lt;/span&gt;The TreeSet class implements Set interface. It uses a tree for storage. Object are stored in sorted, ascending order. Access and retrieval time are quite fast so we use TreeSet when we store large amount of sorted information.&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;20). What is iterator?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;The iterator are used to cycle through the elements in a collection.&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;21). What is listIterator?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;            &lt;/span&gt;ListIterator allow bidiractional traversal of a list. &lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;22). What is RandomAccessInterface?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;23). What is map?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=""&gt;            &lt;/span&gt;The map is object that store association between keys and values,or key/value pair. We give key,we will find value. Both key and value are objects. The key is unique but the values are duplicates.&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in; text-align: justify;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;24). What is map.Entry?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=""&gt;            &lt;/span&gt;The Map.Entry describes an element in a map. This is inner class of Map.&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;25). What is SortedMap?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;The SortedMap extends Map so that the keys are maintained in ascending order.&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;26). What is hashMap?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=""&gt;            &lt;/span&gt;The HashMap class use a hash table to implement the Map interface. This allows the execution time of basic operation such as get() and put(),to remain constant even for large set.&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;27). What is TreeMap?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=""&gt;            &lt;/span&gt;The TreeMap implements the Map interface by using a tree. A TreeMap provides way for storing key/value pair in sorted order. This allow rapid retrieval.&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;28). What is LinkedHashMap?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=""&gt;            &lt;/span&gt;The LinkedHashMap extends HashMap. This maintains a linked list of the entries in the map,in the order in which they are inserted.&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;29). What is the use of Comparator?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;The comparator defines how two objects are compare.&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;30). What are legacy classes?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;            &lt;/span&gt;Dictionaries, Hashtable, Properties, Stack, Vector are legacy classes.&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;31). What are legacy interface?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;There is one legacy interface called Enumeration.&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;32). What is the use of Enumeration?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=""&gt;            &lt;/span&gt;The Enumeration interface defines the methods by which we can enumerate that means obtain one element at a time in a collection of object.&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;33). What is the use of Vector?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Vector implements a dynamic array.&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;34). What is the difference between Vector and ArrayList?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=""&gt;            &lt;/span&gt;Vector implements a dynamic array. It is similar to ArrayList,but with two differences. Vector is synchronized and it contains many legacy methods that are not part of the collection framework.&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;35). What is the use of stack?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Stack is subclass of Vector that implements a standard last-in, first-out stack.&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;36). What is Dictionary?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Dictionary operates like map. Given key, we retrieve value.&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;37). What is HashTable?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;            &lt;/span&gt;It is similar to HashMap but it is synchronized. Like HashMap, HashTable stores key/value pairs in a hash table.&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;38). What is difference between Hashmap and HashTable?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;HashMap contain null values. Whereas HashTable does not allowed null values.&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;            &lt;/span&gt;HashMap in not synchronized. Whereas HashTable is synchronized.&lt;/p&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;39). What is the use of&lt;span style=""&gt;  &lt;/span&gt;Properties?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Properties is a subclass of HashTable. It is used to maintain lists of values in which the key is a String and the value is String. &lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;40). What is the use of store() and load() in properties class?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;Properties object can be easily stored to or loaded from disk with the store() and load() methods.&lt;/p&gt;  &lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 0.75pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in; text-indent: 0.5in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;br /&gt;&lt;/div&gt;&lt;p style="margin-left: -0.75in; text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt; e&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:100%;"&gt;&lt;blockquote&gt;1).       &lt;br /&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="border-style: none none solid; padding: 0in 0in 1pt; text-align: justify;"&gt;&lt;p class="MsoNormal" style="border: medium none ; padding: 0in; margin-left: -0.75in;"&gt;&lt;span style=""&gt;&lt;span class="answers"&gt;&lt;br /&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8329086772546213543-2506872456419382442?l=stepintofuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stepintofuture.blogspot.com/feeds/2506872456419382442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8329086772546213543&amp;postID=2506872456419382442' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8329086772546213543/posts/default/2506872456419382442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8329086772546213543/posts/default/2506872456419382442'/><link rel='alternate' type='text/html' href='http://stepintofuture.blogspot.com/2008/07/java-interview-questions.html' title='JAVA-UTIL PACKAGE'/><author><name>sureshkumar</name><uri>http://www.blogger.com/profile/07546589267927657994</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>
