<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6848366767831631249</id><updated>2024-09-21T22:22:44.517-07:00</updated><category term="Callable Statement"/><category term="Statement."/><category term="prepared Statement"/><title type='text'>Share Your knowledge</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://easytechies.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6848366767831631249/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://easytechies.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>techguru</name><uri>http://www.blogger.com/profile/09350900097010316032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6848366767831631249.post-7876299603013328110</id><published>2012-08-29T09:48:00.008-07:00</published><updated>2012-09-17T10:28:56.847-07:00</updated><title type='text'>Exceptions in Java </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
Exception is an abnormal flow in the execution of program which a method can&#39;t handle the execution itself . This situation is called as an exception .&lt;br /&gt;
&lt;br /&gt;
Come to Java&lt;br /&gt;
&lt;b&gt;There are two types of exceptions in java&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Checked exceptions:&lt;/b&gt;&lt;br /&gt;
checked exceptions are also known as compile time exceptions as they are identified during compile time of the program.Exception and all the subclasses of Exception class are checked exceptions.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Example :&lt;/b&gt; FileNotFoundException .&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Unchecked exceptions:&lt;/b&gt;&lt;br /&gt;
Unchecked Exceptions are also known as runtime exceptions as they are identified during the runtime of the program. class Runtime Exception and all the subclasses of Runtime Exception are unchecked Exceptions.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Examples :&lt;/b&gt; NullPointerException , ArrayIndexOutofBoundException.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Error :&lt;/b&gt;&lt;br /&gt;
Errors should never be created, thrown, caught, or repaired. They are usually beyond the scope of your application code such as &#39;out of memory&#39;. Even if you caught an out of memory error, you wouldn&#39;t likely be in a better place than the system garbage collector to fix this (and you&#39;d have to fix it while allocating no new memory) so its better to let the system crash and repair the root cause.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Errors are :&lt;/b&gt;&lt;br /&gt;
Are always unchecked&lt;br /&gt;
Usually indicate a system error or a problem with a low-level resource&lt;br /&gt;
Should be handled at the system level, if possible&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://easytechies.blogspot.com/feeds/7876299603013328110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://easytechies.blogspot.com/2012/08/types-of-exceptions-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6848366767831631249/posts/default/7876299603013328110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6848366767831631249/posts/default/7876299603013328110'/><link rel='alternate' type='text/html' href='http://easytechies.blogspot.com/2012/08/types-of-exceptions-in-java.html' title='Exceptions in Java '/><author><name>techguru</name><uri>http://www.blogger.com/profile/09350900097010316032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6848366767831631249.post-7874888065411741466</id><published>2012-08-29T09:44:00.001-07:00</published><updated>2012-09-17T10:30:44.556-07:00</updated><title type='text'>Difference between error and Exception </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;b&gt;Exceptions &lt;/b&gt;are things you can create/throw yourself or that might be thrown because of an obvious run-time error such as trying to access a null object or reading an array out of bounds. They can also be caught and repaired by a developer.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Errors &lt;/b&gt;should never be created, thrown, caught, or repaired. They are usually beyond the scope of your application code such as &#39;out of memory&#39;. Even if you caught an out of memory error, you wouldn&#39;t likely be in a better place than the system garbage collector to fix this (and you&#39;d have to fix it while allocating no new memory) so its better to let the system crash and repair the root cause.&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://easytechies.blogspot.com/feeds/7874888065411741466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://easytechies.blogspot.com/2012/08/difference-between-error-and-exception.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6848366767831631249/posts/default/7874888065411741466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6848366767831631249/posts/default/7874888065411741466'/><link rel='alternate' type='text/html' href='http://easytechies.blogspot.com/2012/08/difference-between-error-and-exception.html' title='Difference between error and Exception '/><author><name>techguru</name><uri>http://www.blogger.com/profile/09350900097010316032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6848366767831631249.post-3474959809505550666</id><published>2012-08-29T09:38:00.003-07:00</published><updated>2012-08-29T09:41:35.688-07:00</updated><title type='text'>Exception HIerarchy in Java </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;img src=&quot;http://www.javamex.com/tutorials/exceptions/ExceptionHierarchy.png&quot; /&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;font-family: Verdana, Helvetica, &#39;Gill Sans&#39;, Verdana, arial, sans-serif; font-size: 15px;&quot;&gt;&lt;li&gt;&lt;tt&gt;Exception&lt;/tt&gt;&amp;nbsp;subclasses represent errors that a program can reasonably recover from. Except for&amp;nbsp;&lt;tt&gt;RuntimeException&lt;/tt&gt;&amp;nbsp;and its subclasses (see below), they generally represent errors that a program will&amp;nbsp;&lt;strong&gt;expect to occur in the normal course of duty&lt;/strong&gt;: for example, network connection errors and filing system errors.&lt;/li&gt;
&lt;li&gt;&lt;tt&gt;Error&lt;/tt&gt;&amp;nbsp;subclasses represent &quot;serious&quot; errors that a program generally&amp;nbsp;&lt;strong&gt;shouldn&#39;t expect to catch and recover from&lt;/strong&gt;. These include conditions such as an expected class file being missing, or an&amp;nbsp;&lt;tt&gt;OutOfMemoryError&lt;/tt&gt;.&lt;/li&gt;
&lt;li&gt;&lt;tt&gt;RuntimeException&lt;/tt&gt;&amp;nbsp;is a further subclass of&amp;nbsp;&lt;tt&gt;Exception&lt;/tt&gt;.&amp;nbsp;&lt;tt&gt;RuntimeException&lt;/tt&gt;&amp;nbsp;and&amp;nbsp;&lt;em&gt;its&lt;/em&gt;&amp;nbsp;subclasses are slightly different: they represent exceptions that a program&amp;nbsp;&lt;strong&gt;shouldn&#39;t generally expect to occur, but could potentially recover from&lt;/strong&gt;. They represent what are likely to be&lt;strong&gt;programming errors&lt;/strong&gt;&amp;nbsp;rather than errors due to invalid user input or a badly configured environment.&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://easytechies.blogspot.com/feeds/3474959809505550666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://easytechies.blogspot.com/2012/08/exception-hierarchy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6848366767831631249/posts/default/3474959809505550666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6848366767831631249/posts/default/3474959809505550666'/><link rel='alternate' type='text/html' href='http://easytechies.blogspot.com/2012/08/exception-hierarchy.html' title='Exception HIerarchy in Java '/><author><name>techguru</name><uri>http://www.blogger.com/profile/09350900097010316032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6848366767831631249.post-4304423885834696530</id><published>2012-08-29T09:36:00.000-07:00</published><updated>2012-08-29T09:36:07.946-07:00</updated><title type='text'>JDBC Sample Program </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
JDBCSample.java&lt;br /&gt;
&lt;br /&gt;
import java.sql.*&lt;br /&gt;
&lt;br /&gt;
public class JDBCSample {&lt;br /&gt;
&lt;br /&gt;
public static void main( String args[]) {&lt;br /&gt;
&lt;br /&gt;
String connectionURL = &quot;jdbc:postgresql://localhost:5432/movies;user=java;password=samples&quot;;&lt;br /&gt;
// Change the connection string according to your db, ip, username and password&lt;br /&gt;
&lt;br /&gt;
try {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; // Load the Driver class.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Class.forName(&quot;org.postgresql.Driver&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; // If you are using any other database then load the right driver here.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; //Create the connection using the static getConnection method&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Connection con = DriverManager.getConnection (connectionURL);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; //Create a Statement class to execute the SQL statement&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Statement stmt = con.createStatement();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; //Execute the SQL statement and get the results in a Resultset&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ResultSet rs = stmd.executeQuery(&quot;select moviename, releasedate from movies&quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; // Iterate through the ResultSet, displaying two values&lt;br /&gt;
&amp;nbsp; &amp;nbsp; // for each row using the getString method&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; while (rs.next())&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Name= &quot; + rs.getString(&quot;moviename&quot;) + &quot; Date= &quot; + rs.getString(&quot;releasedate&quot;);&lt;br /&gt;
}&lt;br /&gt;
catch (SQLException e) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; e.printStackTrace();&lt;br /&gt;
}&lt;br /&gt;
catch (Exception e) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; e.printStackTrace();&lt;br /&gt;
}&lt;br /&gt;
finally {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; // Close the connection&lt;br /&gt;
&amp;nbsp; &amp;nbsp; con.close();&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://easytechies.blogspot.com/feeds/4304423885834696530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://easytechies.blogspot.com/2012/08/jdbc-sample-program.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6848366767831631249/posts/default/4304423885834696530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6848366767831631249/posts/default/4304423885834696530'/><link rel='alternate' type='text/html' href='http://easytechies.blogspot.com/2012/08/jdbc-sample-program.html' title='JDBC Sample Program '/><author><name>techguru</name><uri>http://www.blogger.com/profile/09350900097010316032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6848366767831631249.post-4203193616457199529</id><published>2012-08-29T09:34:00.000-07:00</published><updated>2019-09-09T20:48:34.388-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Callable Statement"/><category scheme="http://www.blogger.com/atom/ns#" term="prepared Statement"/><category scheme="http://www.blogger.com/atom/ns#" term="Statement."/><title type='text'>Difference between Statement , Prepared Statement and Callable statement .</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;Statement:&lt;/b&gt;&amp;nbsp;&amp;nbsp;&lt;/h3&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Statement is used to execute normal SQLs , it won&#39;t take any parameters. Generally preferable for DDL statements and normal SQLs without any parameters.&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
Statement st=conn.createStatement();&lt;br /&gt;
st.execute(&quot;create table tableA (columnA int not null, columnB varchar(255) )&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;Prepared Statement:&lt;/b&gt;&lt;/h3&gt;
Prepared statement is used to execute dynamic SQLs with parameters, it extends Statement interface.&lt;br /&gt;
If you are executing the same query multiple times, its preferable to use to the prepared statement , since it pre-compiles the statements&lt;br /&gt;
&lt;br /&gt;
PreparedStatement prepStmt= conn.prepareStatement(&quot;update tableA set column1=? where column2=?&quot;);&lt;br /&gt;
&lt;div class=&quot;line number7 index6 alt2&quot; style=&quot;background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-family: Monaco, Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 16px; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;java plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Monaco, Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot; style=&quot;background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-family: Monaco, Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 16px; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;java plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Monaco, Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;prepStmt&lt;/span&gt;.setString(&lt;/code&gt;&lt;code class=&quot;java value&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: rgb(0, 153, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Monaco, Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;1&lt;/code&gt;&lt;code class=&quot;java plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Monaco, Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;java string&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Monaco, Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&quot;test&quot;&lt;/code&gt;&lt;code class=&quot;java plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Monaco, Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;);&amp;nbsp;&amp;nbsp; &lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot; style=&quot;background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-family: Monaco, Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 16px; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;java plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Monaco, Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;prepStmt&lt;/span&gt;.setInt(&lt;/code&gt;&lt;code class=&quot;java value&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: rgb(0, 153, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Monaco, Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;2&lt;/code&gt;&lt;code class=&quot;java plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Monaco, Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;, &lt;span style=&quot;color: #009900;&quot;&gt;444&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;java plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Monaco, Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Callable Statement: &lt;/b&gt;Execute a call to a database stored procedure. it extends statement interface . It allows the user to send parameters to procedure and retrieve the data from procedure.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CallableStatement cStmt= conn.prepareCall(&quot;call procA(?,?,?)&quot;)&lt;br /&gt;
cStmt.setString(1,&quot;test&quot;);&lt;br /&gt;
cStmt.setInt(2,444);&lt;br /&gt;
cStmt.registerOutParameter(3);&lt;br /&gt;
cStmt.execute();&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://easytechies.blogspot.com/feeds/4203193616457199529/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://easytechies.blogspot.com/2012/08/difference-between-statement-prepared.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6848366767831631249/posts/default/4203193616457199529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6848366767831631249/posts/default/4203193616457199529'/><link rel='alternate' type='text/html' href='http://easytechies.blogspot.com/2012/08/difference-between-statement-prepared.html' title='Difference between Statement , Prepared Statement and Callable statement .'/><author><name>techguru</name><uri>http://www.blogger.com/profile/09350900097010316032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6848366767831631249.post-1099803570461622887</id><published>2012-08-23T10:49:00.001-07:00</published><updated>2012-08-23T10:53:22.297-07:00</updated><title type='text'>Collections Framework in Java</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h3&gt;&lt;br /&gt;
&lt;/h3&gt;&lt;b&gt;Collections in Java :&lt;/b&gt;&lt;br /&gt;
The Java collections framework standardizes the way in which groups of objects are handled by your programs.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;The Collection Interfaces:&lt;/b&gt;&lt;br /&gt;
The collections framework defines several interfaces. This section provides an overview of each interface:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Interface Description&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Collection &lt;/b&gt;Enables you to work with groups of objects; it is at the top of the collections hierarchy&lt;br /&gt;
&lt;b&gt;List &lt;/b&gt;Extends Collection to handle sequences (lists of objects)&lt;br /&gt;
&lt;b&gt;Set &lt;/b&gt;Extends Collection to handle sets, which must contain unique elements&lt;br /&gt;
&lt;b&gt;SortedSet &lt;/b&gt;Extends Set to handle sorted sets&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;The Collection Classes:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;AbstractCollection&lt;/b&gt; Implements most of the Collection interface.&lt;br /&gt;
&lt;b&gt;AbstractList &lt;/b&gt;Extends AbstractCollection and implements most of the List interface.&lt;br /&gt;
&lt;b&gt;AbstractSequentialList &lt;/b&gt;Extends AbstractList for use by a collection that uses sequential rather than random access of its elements.&lt;br /&gt;
&lt;b&gt;LinkedList &lt;/b&gt;Implements a linked list by extending AbstractSequentialList.&lt;br /&gt;
&lt;b&gt;ArrayList &lt;/b&gt;Implements a dynamic array by extending &amp;nbsp;AbstractList.&lt;br /&gt;
&lt;b&gt;SortedSet &lt;/b&gt;subSet(Object start, Object end) Returns a SortedSet that includes those elements between start and end–1. Elements in the returned &amp;nbsp;collection are also referenced by the invoking object.&lt;br /&gt;
&lt;b&gt;SortedSet &lt;/b&gt;tailSet(Object start) Returns a SortedSet that contains &amp;nbsp;those elements greater than or equal to start that are contained in the sorted set. Elements in the returned&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;set &lt;/b&gt;are also referenced by the invoking object.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;AbstractSet &lt;/b&gt;Extends AbstractCollection and implements most of the Set interface.&lt;br /&gt;
&lt;b&gt;HashSet &lt;/b&gt;Extends AbstractSet for use with a hash table.&lt;br /&gt;
&lt;b&gt;LinkedHashSet &lt;/b&gt;Extends HashSet to allow insertion-order iterations.&lt;br /&gt;
&lt;b&gt;TreeSet &lt;/b&gt;Implements a set stored in a tree. Extends AbstractSet.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://easytechies.blogspot.com/feeds/1099803570461622887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://easytechies.blogspot.com/2012/08/collections-framework-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6848366767831631249/posts/default/1099803570461622887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6848366767831631249/posts/default/1099803570461622887'/><link rel='alternate' type='text/html' href='http://easytechies.blogspot.com/2012/08/collections-framework-in-java.html' title='Collections Framework in Java'/><author><name>techguru</name><uri>http://www.blogger.com/profile/09350900097010316032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6848366767831631249.post-6576775402774387348</id><published>2012-08-22T10:43:00.000-07:00</published><updated>2012-08-22T10:43:09.526-07:00</updated><title type='text'>Introduction to OOPS Concepts </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;b&gt;Class :&lt;/b&gt; is the real world entity . &amp;nbsp;It is the central point of OOP and that contains data and codes with behavior. In Java everything happens within class and it describes a set of objects with common behavior. The class definition describes all the properties, behavior, and identity of objects present within that class.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;b&gt;Object : &lt;/b&gt;Object is an instance of a class . Objects are the basic unit of object orientation with behavior, identity. As we mentioned above, these are part of a class but are not the same. An object is expressed by the variable and methods within the objects. Again these variables and methods are distinguished from each other as instant variables, instant methods and class variable and class methods&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;b&gt;Methods :&lt;/b&gt; &amp;nbsp;We know that a class can define both attributes and behaviors. Again attributes are defined by variables and behaviors are represented by methods. In other words, methods define the abilities of an object.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;b&gt;Inheritance :&lt;/b&gt; This is the mechanism of organizing and structuring software program. Though objects are distinguished from each other by some additional features but there are objects that share certain things common. In object oriented programming classes can inherit some common behavior and state from others. Inheritance in OOP allows to define a general class and later to organize some other classes simply adding some details with the old class definition. This saves work as the special class inherits all the properties of the old general class and as a programmer you only require the new features. This helps in a better data analysis, accurate coding and reduces development time.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;b&gt;Abstraction :&lt;/b&gt; The process of abstraction in Java is used to hide certain details and only show the essential features of the object. In other words, it deals with the outside view of an object (interface).&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;b&gt;Encapsulation -:&lt;/b&gt; This helps in hiding an object&#39;s data describing its state from any further modification by external component.This is an important programming concept that assists in separating an object&#39;s state from its behavior. In Java there are four different terms used for hiding data constructs and these are public, private, protected and package.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;b&gt;Polymorphism :&lt;/b&gt; Polymorphism is the ability of an object to take on many forms. The most common use of polymorphism in OOP occurs when a parent class reference is used to refer to a child class object.Any java object that can pass more than one IS-A test is considered to be polymorphic. In Java, all java objects are polymorphic since any object will pass the IS-A test for their own type and for the class Object.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;b&gt;JIT:Just in Time Compiler&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;When JVM compiles the class file he does not compile&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;the full class file in one shot. Compilation is done on function basis or file basis. Advantage gained from this is that heavy parsing of original source code is avoided. Depending on need basis the compilation is done. This typ of compilation is termed as JIT or Just-in-Time compilation.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;Just-in-time compiler is a compiler used to convert the Commmon Intermediate Language (CIL) code into native code (also called machine code) that is processed by machine.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;A little description&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;While compiling of .NET program, its code is converted into Common Intermediate Language code that is done by Common Language Runtime.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;But while executing the program this CIL code is converted into Machine code or Native code that is done by JIT Compiler.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;b&gt;Abstract Class :&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;An abstract class is a class that is declared by using the abstract keyword. It may or may not have abstract methods. Abstract classes cannot be instantiated, but they can be extended into sub-classes.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; --or--&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, &#39;bitstream vera sans&#39;, sans-serif; font-size: x-small; line-height: 21px;&quot;&gt;Java provides a special type of class called an abstract class. Which helps us to organize our classes based on common methods. An abstract class lets you put the common method names in one abstract class without having to write the actual implementation code.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;An abstract class can be extended into sub-classes, these sub-classes usually provide implementations for all of the abstract methods.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;The key idea with an abstract class is useful when there is common functionality that&#39;s &amp;nbsp;like to implement in a superclass and some behavior is unique to specific classes. So you implement the superclass as an abstract class and define methods that have common subclasses. Then you implement each subclass by extending the abstract class and add the methods unique to the class.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;b style=&quot;font-family: verdana, &#39;bitstream vera sans&#39;, sans-serif; font-size: small; line-height: 21px;&quot;&gt;Points of abstract class :&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;Abstract class contains abstract methods.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;Program can&#39;t instantiate an abstract class.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;Abstract classes contain mixture of non-abstract and abstract methods.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;If any class contains abstract methods then it must implements all the abstract methods of the abstract class.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, bitstream vera sans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;div style=&quot;font-family: verdana, &#39;bitstream vera sans&#39;, sans-serif; font-size: 13px; line-height: 21px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: verdana, &#39;bitstream vera sans&#39;, sans-serif; font-size: 13px; line-height: 21px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: verdana, &#39;bitstream vera sans&#39;, sans-serif; font-size: 13px; line-height: 21px;&quot;&gt;
&lt;b&gt;Access Modifiers in Java :&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: verdana, &#39;bitstream vera sans&#39;, sans-serif; font-size: 13px; line-height: 21px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: verdana, &#39;bitstream vera sans&#39;, sans-serif; font-size: 13px; line-height: 21px;&quot;&gt;
All the four&amp;nbsp;&lt;em&gt;public, private, protected and no modifer&lt;/em&gt;&amp;nbsp;is allowed.&lt;/div&gt;
&lt;ul style=&quot;font-family: verdana, &#39;bitstream vera sans&#39;, sans-serif; font-size: 13px; line-height: 21px;&quot;&gt;
&lt;li style=&quot;list-style-image: url(http://javapapers.com/wp-content/themes/papers/images/bullet.png);&quot;&gt;public and no modifier – the same way as used in class level.&lt;/li&gt;
&lt;li style=&quot;list-style-image: url(http://javapapers.com/wp-content/themes/papers/images/bullet.png);&quot;&gt;private – members CAN ONLY access.&lt;/li&gt;
&lt;li style=&quot;list-style-image: url(http://javapapers.com/wp-content/themes/papers/images/bullet.png);&quot;&gt;protected – CAN be accessed from ‘same package’ and a subclass existing in any package can access.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: verdana, &#39;bitstream vera sans&#39;, sans-serif; font-size: 13px; line-height: 21px;&quot;&gt;
For better understanding, member level access is formulated as a table:&lt;/div&gt;
&lt;table border=&quot;1&quot; bordercolor=&quot;#ffa500&quot; cellspacing=&quot;0&quot; style=&quot;color: black; font-family: verdana, &#39;bitstream vera sans&#39;, sans-serif; font-size: 13px; line-height: 21px; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;
&lt;h3 style=&quot;color: #223344; font-family: &#39;Trebuchet MS&#39;, Helvetica, sans-serif; line-height: 16px;&quot;&gt;
&lt;em&gt;Access Modifiers&lt;/em&gt;&lt;/h3&gt;
&lt;em&gt;&lt;/em&gt;&lt;/td&gt;&lt;td&gt;&lt;em&gt;Same Class&lt;/em&gt;&lt;/td&gt;&lt;td&gt;&lt;em&gt;Same Package&lt;/em&gt;&lt;/td&gt;&lt;td&gt;&lt;em&gt;Subclass&lt;/em&gt;&lt;/td&gt;&lt;td&gt;&lt;em&gt;Other packages&lt;/em&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;public&lt;/strong&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;Y&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;Y&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;Y&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;Y&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;protected&lt;/strong&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;Y&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;Y&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;Y&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;N&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;no access modifier&lt;/strong&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;Y&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;Y&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;N&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;N&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;private&lt;/strong&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;Y&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;N&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;N&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;N&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;font-family: verdana, &#39;bitstream vera sans&#39;, sans-serif; font-size: 13px; line-height: 21px;&quot;&gt;
First row {public Y Y Y Y} should be interpreted as:&lt;/div&gt;
&lt;ul style=&quot;font-family: verdana, &#39;bitstream vera sans&#39;, sans-serif; font-size: 13px; line-height: 21px;&quot;&gt;
&lt;li style=&quot;list-style-image: url(http://javapapers.com/wp-content/themes/papers/images/bullet.png);&quot;&gt;Y – A member declared with ‘public’ access modifier CAN be accessed by the members of the ‘same class’.&lt;/li&gt;
&lt;li style=&quot;list-style-image: url(http://javapapers.com/wp-content/themes/papers/images/bullet.png);&quot;&gt;Y – A member declared with ‘public’ access modifier CAN be accessed by the members of the ‘same package’.&lt;/li&gt;
&lt;li style=&quot;list-style-image: url(http://javapapers.com/wp-content/themes/papers/images/bullet.png);&quot;&gt;Y – A member declared with ‘public’ access modifier CAN be accessed by the members of the ‘subclass’.&lt;/li&gt;
&lt;li style=&quot;list-style-image: url(http://javapapers.com/wp-content/themes/papers/images/bullet.png);&quot;&gt;Y – A member declared as ‘public’ CAN be accessed from ‘Other packages’.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: verdana, &#39;bitstream vera sans&#39;, sans-serif; font-size: 13px; line-height: 21px;&quot;&gt;
Second row {protected Y Y Y N} should be interpreted as:&lt;/div&gt;
&lt;ul style=&quot;font-family: verdana, &#39;bitstream vera sans&#39;, sans-serif; font-size: 13px; line-height: 21px;&quot;&gt;
&lt;li style=&quot;list-style-image: url(http://javapapers.com/wp-content/themes/papers/images/bullet.png);&quot;&gt;Y – A member declared with ‘protected’ access modifier CAN be accessed by the members of the ‘same class’.&lt;/li&gt;
&lt;li style=&quot;list-style-image: url(http://javapapers.com/wp-content/themes/papers/images/bullet.png);&quot;&gt;Y – A member declared with ‘protected’ access modifier CAN be accessed by the members of the ‘same package’.&lt;/li&gt;
&lt;li style=&quot;list-style-image: url(http://javapapers.com/wp-content/themes/papers/images/bullet.png);&quot;&gt;Y – A member declared with ‘protected’ access modifier CAN be accessed by the members of the ‘subclass’.&lt;/li&gt;
&lt;li style=&quot;list-style-image: url(http://javapapers.com/wp-content/themes/papers/images/bullet.png);&quot;&gt;N – A member declared with ‘protected’ access modifier CANNOT be accessed by the members of the ‘Other package’.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: verdana, &#39;bitstream vera sans&#39;, sans-serif; font-size: 13px; line-height: 21px;&quot;&gt;
similarly interpret the access modifiers table for the third (no access modifier) and fourth (private access modifier) records.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://easytechies.blogspot.com/feeds/6576775402774387348/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://easytechies.blogspot.com/2012/08/introduction-to-oops-concepts.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6848366767831631249/posts/default/6576775402774387348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6848366767831631249/posts/default/6576775402774387348'/><link rel='alternate' type='text/html' href='http://easytechies.blogspot.com/2012/08/introduction-to-oops-concepts.html' title='Introduction to OOPS Concepts '/><author><name>techguru</name><uri>http://www.blogger.com/profile/09350900097010316032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6848366767831631249.post-2149763442037860383</id><published>2012-08-21T10:49:00.001-07:00</published><updated>2012-08-21T10:49:44.208-07:00</updated><title type='text'>Difference between java and C ++ </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;C++&lt;/b&gt; was designed for systems and applications programming, extending the &lt;a href=&quot;http://en.wikipedia.org/wiki/C_%28programming_language%29&quot; title=&quot;C (programming language)&quot;&gt;C programming language&lt;/a&gt;. To this &lt;a href=&quot;http://en.wikipedia.org/wiki/Procedural_programming&quot; title=&quot;Procedural programming&quot;&gt;procedural programming&lt;/a&gt; language designed for efficient execution, C++ has added support for &lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Static_typing&quot; title=&quot;Static typing&quot;&gt;statically-typed&lt;/a&gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/Object-oriented_programming&quot; title=&quot;Object-oriented programming&quot;&gt;object-oriented programming&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/Exception_handling&quot; title=&quot;Exception handling&quot;&gt;exception handling&lt;/a&gt;, &lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/RAII&quot; title=&quot;RAII&quot;&gt;scoped resource management&lt;/a&gt;, and &lt;a href=&quot;http://en.wikipedia.org/wiki/Generic_programming&quot; title=&quot;Generic programming&quot;&gt;generic programming&lt;/a&gt;, in particular. It also added a &lt;a href=&quot;http://en.wikipedia.org/wiki/C%2B%2B_Standard_Library&quot; title=&quot;C++ Standard Library&quot;&gt;standard library&lt;/a&gt; which includes generic containers and algorithms.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Java&lt;/b&gt; was created initially as an interpreter for printing systems but grew to support &lt;a href=&quot;http://en.wikipedia.org/wiki/Network_computing&quot; title=&quot;Network computing&quot;&gt;network computing&lt;/a&gt;.
 It is good for beginner programmers because it is easier to see how 
things work, with the already made methods(functions) being more like 
real words and it being very object-oriented. Sun Microsystems used to 
use it for the basis of their &quot;HotJava&quot; thin client system. It relies on
 a &lt;a href=&quot;http://en.wikipedia.org/wiki/Virtual_machine&quot; title=&quot;Virtual machine&quot;&gt;virtual machine&lt;/a&gt; to be &lt;a href=&quot;http://en.wikipedia.org/wiki/Computer_security&quot; title=&quot;Computer security&quot;&gt;secure&lt;/a&gt; and highly &lt;a href=&quot;http://en.wikipedia.org/wiki/Porting&quot; title=&quot;Porting&quot;&gt;portable&lt;/a&gt;.
 It is bundled with an extensive library designed to provide a complete 
abstraction of the underlying platform. Java is a statically-typed 
object-oriented language that uses a syntax similar to C++, but is not 
compatible with it. It was designed from scratch with the goal of being 
easy to use and accessible to a wider audience. It has a thing called &lt;a href=&quot;http://en.wikipedia.org/wiki/Javadoc&quot; title=&quot;Javadoc&quot;&gt;Javadoc&lt;/a&gt; that explains every part in detail.&lt;sup class=&quot;noprint Inline-Template&quot; style=&quot;white-space: nowrap;&quot;&gt;[&lt;i&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Wikipedia:Vagueness&quot; title=&quot;Wikipedia:Vagueness&quot;&gt;&lt;span title=&quot;You can help — from August 2012&quot;&gt;vague&lt;/span&gt;&lt;/a&gt;&lt;/i&gt;]&lt;/sup&gt; It is usually 1X - 4X slower than C++.&lt;sup class=&quot;Template-Fact&quot; style=&quot;white-space: nowrap;&quot;&gt;[&lt;i&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Wikipedia:Citation_needed&quot; title=&quot;Wikipedia:Citation needed&quot;&gt;&lt;span title=&quot;This claim needs references to reliable sources from August 2012&quot;&gt;citation needed&lt;/span&gt;&lt;/a&gt;&lt;/i&gt;]&lt;/sup&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://easytechies.blogspot.com/feeds/2149763442037860383/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://easytechies.blogspot.com/2012/08/difference-between-java-and-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6848366767831631249/posts/default/2149763442037860383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6848366767831631249/posts/default/2149763442037860383'/><link rel='alternate' type='text/html' href='http://easytechies.blogspot.com/2012/08/difference-between-java-and-c.html' title='Difference between java and C ++ '/><author><name>techguru</name><uri>http://www.blogger.com/profile/09350900097010316032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>