<?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-4105123969746300472</id><updated>2024-09-04T17:50:34.757-07:00</updated><category term="Java"/><category term="wiki"/><category term="Android"/><category term="Android Studio"/><category term="String"/><category term="collections"/><category term="tutorial"/><category term="Collections.List"/><category term="hashmap"/><category term="thread"/><category term="Android UI widget"/><category term="Set"/><category term="arrayList"/><category term="java programs"/><category term="list"/><category term="multithreading"/><category term="Checked Exception"/><category term="Iterator"/><category term="Jdbc"/><category term="Jdbc Tutorial"/><category term="Life cycle of a thread in java"/><category term="Program in Java To print Fibonacci series"/><category term="Program in Java To print Fibonacci series with user input"/><category term="Types of Exception"/><category term="Unchecked Exception"/><category term="exception"/><category term="exception handling"/><category term="fibonacci series"/><category term="hashtable"/><category term="interview"/><category term="java coding"/><category term="objects"/><category term="overriding"/><category term="overriding in java"/><category term="sorting of ArrayList"/><category term="static class"/><category term="string in java"/><category term="thread in java"/><category term="=="/><category term="Android Calculator"/><category term="Android Calculator Example"/><category term="Caculator"/><category term="Collections in java"/><category term="Count the Number of Vowels in Java String"/><category term="Database connectivity"/><category term="Difference between Throw and Throws"/><category term="Hello WOrld ANdroid"/><category term="How Objects are stored in heap and Stack in java"/><category term="How to add instance of a class to list and then retrieve it"/><category term="Implementations of map"/><category term="Installation"/><category term="Internal working of array List"/><category term="JAXB"/><category term="JAXB Architecture"/><category term="JAXB tutorial"/><category term="JDBC Basics"/><category term="JDBC Connection"/><category term="JSP include directive JSP include action"/><category term="Java program to reverse a string"/><category term="List in java"/><category term="Program in Java To print Fibonacci series first 20 numbers"/><category term="Program in Java To print Fibonacci series with user input using recursive method"/><category term="Program to find a prime number in java"/><category term="Program to remove a particular character from a sentence"/><category term="Reverse a string"/><category term="Reverse a string in java"/><category term="Reverse of array list"/><category term="Temperature Conversion"/><category term="Throw Keyword"/><category term="Throws Keyword"/><category term="To add list in another list"/><category term="android Button example"/><category term="application server"/><category term="arrays.sort().collections.sort()"/><category term="constructor"/><category term="constructor in java"/><category term="constructor interview questions"/><category term="count substring"/><category term="custom exception"/><category term="design pattern"/><category term="difference between hash table and hasmap"/><category term="equals()"/><category term="find position of string in java"/><category term="first position of string in another string"/><category term="get in hashmap"/><category term="hashmap in java"/><category term="heap"/><category term="instanceof"/><category term="jboss"/><category term="lifecylcle"/><category term="linkedhashmap"/><category term="map"/><category term="mergesort algorithm"/><category term="palindrome"/><category term="position of string"/><category term="prime number"/><category term="put in hashmap"/><category term="reverse of string"/><category term="runnable interface"/><category term="samsung"/><category term="samsung galaxy  note 4"/><category term="serialization in java"/><category term="setter method"/><category term="split"/><category term="stack"/><category term="static"/><category term="static method overriding in java"/><category term="static variables"/><category term="string reverse"/><category term="stringbuffer"/><category term="stringbuilder"/><category term="tomcat"/><category term="treemap"/><category term="type of map"/><category term="web server"/><category term="web service"/><category term="weblogic"/><category term="why string is immutable"/><category term="working of hashmap"/><title type='text'>JavaTutorial Blog,Android tutorial</title><subtitle type='html'>Blog for Java,CoreJava,Collections Framework,Java Interview Questions ,Top Java Interview Questions ,Collections Interview Questions ,Java Programs,Android tutorial,Android Studio</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</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>61</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4105123969746300472.post-8898215475752124121</id><published>2015-04-15T11:27:00.001-07:00</published><updated>2018-10-26T02:32:02.642-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Android Studio"/><category scheme="http://www.blogger.com/atom/ns#" term="Android UI widget"/><category scheme="http://www.blogger.com/atom/ns#" term="Temperature Conversion"/><title type='text'>Android Studio Temperature Conversion</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Hi , Now I am moving towards new Program that is Android Studio Calculator , a very basic calculator which will look as below :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3w3iw5K-WdieTK7g77xky3ekOy4MVX6gIJLoSgVogfZs0y5ijzHjZNe3ddPSau2Wq8HM920CebgyWUtOpX-dnKEY3o4IEDj6WixIIfJDYx_obcYEYeJxCYjaqc8kvgeKK5U6cdy1nZGA/s1600/3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3w3iw5K-WdieTK7g77xky3ekOy4MVX6gIJLoSgVogfZs0y5ijzHjZNe3ddPSau2Wq8HM920CebgyWUtOpX-dnKEY3o4IEDj6WixIIfJDYx_obcYEYeJxCYjaqc8kvgeKK5U6cdy1nZGA/s1600/3.jpg&quot; width=&quot;414&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: 12.8000001907349px;&quot;&gt;Temperature Converter Android Studio&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
This link has been moved to a new site here -----&amp;gt;&amp;nbsp;&lt;a href=&quot;http://www.javainhouse.com/2016/01/android-studio-temperature-conversion.html&quot; target=&quot;_blank&quot;&gt;Android Studio Temperature Conversion&amp;nbsp;&lt;/a&gt;&lt;br /&gt;
http://www.javainhouse.com/2016/01/android-studio-temperature-conversion.html&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/8898215475752124121/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2015/04/android-studio-temperature-conversion.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/8898215475752124121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/8898215475752124121'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2015/04/android-studio-temperature-conversion.html' title='Android Studio Temperature Conversion'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3w3iw5K-WdieTK7g77xky3ekOy4MVX6gIJLoSgVogfZs0y5ijzHjZNe3ddPSau2Wq8HM920CebgyWUtOpX-dnKEY3o4IEDj6WixIIfJDYx_obcYEYeJxCYjaqc8kvgeKK5U6cdy1nZGA/s72-c/3.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4105123969746300472.post-5295686340005288886</id><published>2015-02-13T12:31:00.001-08:00</published><updated>2015-02-13T12:31:03.822-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="find position of string in java"/><category scheme="http://www.blogger.com/atom/ns#" term="first position of string in another string"/><category scheme="http://www.blogger.com/atom/ns#" term="position of string"/><category scheme="http://www.blogger.com/atom/ns#" term="String"/><category scheme="http://www.blogger.com/atom/ns#" term="string in java"/><title type='text'>WAP to find first Position of a String in another String</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Hi , My today&#39;s post is on a program to find&amp;nbsp;&amp;nbsp;Position of a String in another String.&lt;br /&gt;
For Example ,&lt;span style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px;&quot;&gt;Given two strings, A and B, how to find the first position of B in A? For instance, A = &quot; ab123cdefgcde&quot;; B= &quot;cde&quot; Then the first position of B in A is 6.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
import java.util.Scanner;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public class SB&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;public static void main(String[] args) {&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp;String test=null;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;String index=null;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;int j=0;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;System.out.println(&quot;Enter the string&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp;test= new Scanner(System.in).nextLine();&lt;br /&gt;
&amp;nbsp; &amp;nbsp;System.out.println(&quot;Enter the substring you want to count&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp;index= new Scanner(System.in).nextLine();&lt;br /&gt;
&amp;nbsp; &amp;nbsp;for (int i = 0; i &amp;lt;= test.length()-index.length(); i++) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; String testing=test.substring(i, index.length()+i);&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if(testing.equals(index))&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;j=i+1;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; System.out.println(&quot;It occurs first &amp;nbsp;at &quot;+ j +&quot; position&quot; );&lt;br /&gt;
&amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/5295686340005288886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2015/02/wap-to-find-first-position-of-string-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/5295686340005288886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/5295686340005288886'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2015/02/wap-to-find-first-position-of-string-in.html' title='WAP to find first Position of a String in another String'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</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-4105123969746300472.post-2494926179346287438</id><published>2015-02-07T05:29:00.000-08:00</published><updated>2018-11-09T01:31:35.071-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Android Calculator"/><category scheme="http://www.blogger.com/atom/ns#" term="Android Calculator Example"/><category scheme="http://www.blogger.com/atom/ns#" term="Android Studio"/><category scheme="http://www.blogger.com/atom/ns#" term="Android UI widget"/><category scheme="http://www.blogger.com/atom/ns#" term="Caculator"/><title type='text'>Android Studio Calculator Example</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Hi , Now I am moving towards new Program that is Android Studio Calculator , a very basic calculator which will look as below :&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHTlavAZpFzC5QpcQ_k1YhxD2Y4QQwKhwgAHojQSRZTj2BE_Gu9WCpHMEUvjxaHlfXX8mYHxTE2vID-i91dRoMJ_UhGVYSbOSo_UzOC9CRWiAH60TFf1af3vBlEIeP8kiw0Sk7csGCp0s/s1600/phpRpZS7TAM.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Calculator Example Android Studio&quot; border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHTlavAZpFzC5QpcQ_k1YhxD2Y4QQwKhwgAHojQSRZTj2BE_Gu9WCpHMEUvjxaHlfXX8mYHxTE2vID-i91dRoMJ_UhGVYSbOSo_UzOC9CRWiAH60TFf1af3vBlEIeP8kiw0Sk7csGCp0s/s1600/phpRpZS7TAM.jpg&quot; title=&quot;Calculator Example Android Studio&quot; width=&quot;336&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
This link has been moved to new address&lt;/h3&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;http://www.javainhouse.com/2016/01/android-studio-calculator-example.html&lt;/h3&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/2494926179346287438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2015/02/android-studio-calculator-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/2494926179346287438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/2494926179346287438'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2015/02/android-studio-calculator-example.html' title='Android Studio Calculator Example'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHTlavAZpFzC5QpcQ_k1YhxD2Y4QQwKhwgAHojQSRZTj2BE_Gu9WCpHMEUvjxaHlfXX8mYHxTE2vID-i91dRoMJ_UhGVYSbOSo_UzOC9CRWiAH60TFf1af3vBlEIeP8kiw0Sk7csGCp0s/s72-c/phpRpZS7TAM.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4105123969746300472.post-1251767199496642960</id><published>2015-02-05T09:29:00.001-08:00</published><updated>2018-11-09T01:32:53.723-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="android Button example"/><category scheme="http://www.blogger.com/atom/ns#" term="Android Studio"/><category scheme="http://www.blogger.com/atom/ns#" term="Android UI widget"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Android Button Example</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Hi Today&#39;s my post on How to use Button in Android .Button is a UI widget . If you are very beginner first go through my first example of&lt;a href=&quot;http://javatutorialhere.blogspot.in/2015/02/hello-world-android-studio.html&quot; target=&quot;_blank&quot;&gt; Android Hello World &lt;/a&gt;which helps you how to run a very basic program in android.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1l7e5NViWJEZutUkHTM06LKD94ZfUCor9aQ8qeQ-FhSjERUD6W-a3xHsxpggaSmaPzpOXFEsBvs3csqz8kaSqDOUo18G3f0tQpB4nsw5Hcp7Lzx2zzSgYMyL7hpoOEiSwAjBD5Z5T27o/s1600/6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Android Button Example&quot; border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1l7e5NViWJEZutUkHTM06LKD94ZfUCor9aQ8qeQ-FhSjERUD6W-a3xHsxpggaSmaPzpOXFEsBvs3csqz8kaSqDOUo18G3f0tQpB4nsw5Hcp7Lzx2zzSgYMyL7hpoOEiSwAjBD5Z5T27o/s1600/6.png&quot; title=&quot;Android Button Example&quot; width=&quot;436&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
This link has been moved to new address&amp;nbsp; :&amp;nbsp;&amp;nbsp;http://www.javainhouse.com/2016/01/button-example-android-studio.html&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/1251767199496642960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2015/02/android-button-examplea.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/1251767199496642960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/1251767199496642960'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2015/02/android-button-examplea.html' title='Android Button Example'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1l7e5NViWJEZutUkHTM06LKD94ZfUCor9aQ8qeQ-FhSjERUD6W-a3xHsxpggaSmaPzpOXFEsBvs3csqz8kaSqDOUo18G3f0tQpB4nsw5Hcp7Lzx2zzSgYMyL7hpoOEiSwAjBD5Z5T27o/s72-c/6.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4105123969746300472.post-148313438724710850</id><published>2015-02-01T10:33:00.000-08:00</published><updated>2018-11-09T01:35:18.118-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Android Studio"/><category scheme="http://www.blogger.com/atom/ns#" term="Hello WOrld ANdroid"/><title type='text'>Hello World Android Studio</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Hi, After &lt;a href=&quot;http://javatutorialhere.blogspot.in/2015/02/android-studio-installation.html&quot; target=&quot;_blank&quot;&gt;installing Android Studio&lt;/a&gt; Let us see how to create our very first program Hello World&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
This link has been moved to a new site here -----&amp;gt;&amp;nbsp;&lt;a href=&quot;http://www.javainhouse.com/2016/01/hello-world-android-studio.html&quot; target=&quot;_blank&quot;&gt;Hello World Android Studio&lt;/a&gt;&lt;/h3&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;h3&gt;
Step 8: Run&amp;nbsp;&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Run this program and this will show you the output on emulator .I am using Nexus 7 as AVD .How to add a AVD in your studio you can see here.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisv0-OyUzUSAw5IEikVvp94D1j6qcaFqS4TnnAAGmlz5UgTlFb6joyFuAsTz1lN79K-WSI8JFLrNxiJHSVWIgYr6I4-Cv2CdVc768qvuU9xMRgkXH3UbVoKL29_Ns-P_oBKxhc6NFrXw4/s1600/9.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Hello World Android Studio&quot; border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisv0-OyUzUSAw5IEikVvp94D1j6qcaFqS4TnnAAGmlz5UgTlFb6joyFuAsTz1lN79K-WSI8JFLrNxiJHSVWIgYr6I4-Cv2CdVc768qvuU9xMRgkXH3UbVoKL29_Ns-P_oBKxhc6NFrXw4/s1600/9.jpg&quot; title=&quot;Hello World Android Studio&quot; width=&quot;424&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Hello World Android&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div&gt;
If you are facing some errors in running the above program you can refer below as I was also facing many errors so I have drafted them for your help .&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
See :&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://javatutorialhere.blogspot.in/2015/02/android-button-examplea.html&quot; target=&quot;_blank&quot;&gt;Android Button Example&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://javatutorialhere.blogspot.in/2015/02/android-studio-calculator-example.html&quot; target=&quot;_blank&quot;&gt;Calculator with Android Studio&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/148313438724710850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2015/02/hello-world-android-studio.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/148313438724710850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/148313438724710850'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2015/02/hello-world-android-studio.html' title='Hello World Android Studio'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisv0-OyUzUSAw5IEikVvp94D1j6qcaFqS4TnnAAGmlz5UgTlFb6joyFuAsTz1lN79K-WSI8JFLrNxiJHSVWIgYr6I4-Cv2CdVc768qvuU9xMRgkXH3UbVoKL29_Ns-P_oBKxhc6NFrXw4/s72-c/9.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4105123969746300472.post-6160566241702860441</id><published>2015-02-01T10:14:00.001-08:00</published><updated>2015-02-05T11:10:21.890-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Android Studio"/><category scheme="http://www.blogger.com/atom/ns#" term="Installation"/><title type='text'>Android Studio Installation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: #f9f9f9; color: #222222; font-family: Roboto, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 15px;&quot;&gt;
Android Studio is the official IDE for Android application development, based on&amp;nbsp;IntelliJ IDEA. On top of the capabilities you expect from IntelliJ, Android Studio offers:&lt;/div&gt;
&lt;ul style=&quot;background-color: #f9f9f9; color: #222222; font-family: Roboto, sans-serif; font-size: 14px; line-height: 19px; margin: 0px 0px 15px 18px; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px 0px 5px;&quot;&gt;Flexible Gradle-based build system&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 5px;&quot;&gt;Build variants and multiple&amp;nbsp;&lt;code style=&quot;color: #006600; font-size: 13px; font-stretch: normal; line-height: 14px;&quot;&gt;apk&lt;/code&gt;&amp;nbsp;file generation&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 5px;&quot;&gt;Code templates to help you build common app features&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 5px;&quot;&gt;Rich layout editor with support for drag and drop theme editing&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 5px;&quot;&gt;Lint tools to catch performance, usability, version compatibility, and other problems&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 5px;&quot;&gt;ProGuard and app-signing capabilities&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 5px;&quot;&gt;Built-in support for&amp;nbsp;Google Cloud Platform, making it easy to integrate Google Cloud Messaging and App Engine&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: Roboto, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: Roboto, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;You can download Android Studio from the link below:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: Roboto, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: Roboto, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;http://developer.android.com/sdk/index.html&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: Roboto, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: Roboto, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: Roboto, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp;After downloading Android Studio keep on clicking next and install android studio .&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Roboto, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #222222; font-family: Roboto, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #222222; font-family: Roboto, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;You may like :&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Roboto, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;a href=&quot;http://javatutorialhere.blogspot.com/2015/02/hello-world-android-studio.html&quot; target=&quot;_blank&quot;&gt;Android Studio Hello World Program&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Roboto, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;a href=&quot;http://javatutorialhere.blogspot.in/2015/02/android-button-examplea.html&quot; target=&quot;_blank&quot;&gt;Android Button Example&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Roboto, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #222222; font-family: Roboto, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/6160566241702860441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2015/02/android-studio-installation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/6160566241702860441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/6160566241702860441'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2015/02/android-studio-installation.html' title='Android Studio Installation'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</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-4105123969746300472.post-1110145646064463399</id><published>2015-01-27T21:40:00.000-08:00</published><updated>2016-01-20T02:33:07.315-08:00</updated><title type='text'>Program for Shifting characters in a String eg. String &quot;abcde&quot; should be printed as &quot;eabcd&quot;</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&gt;
&lt;/h3&gt;
&lt;br /&gt;
import java.util.Scanner;&lt;br /&gt;
&lt;br /&gt;
public class SB&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; public static void main(String []args) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; Scanner in = new Scanner(System.in);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.println(&quot;Enter a string to shift characters&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; String &amp;nbsp;test = in.nextLine();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;For further visit &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://javainhouse.blogspot.in/&quot; target=&quot;_blank&quot;&gt;Javainhouse&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/1110145646064463399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2015/01/program-for-shifting-characters-of-a-string.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/1110145646064463399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/1110145646064463399'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2015/01/program-for-shifting-characters-of-a-string.html' title='Program for Shifting characters in a String eg. String &quot;abcde&quot; should be printed as &quot;eabcd&quot;'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</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-4105123969746300472.post-5840622506255696083</id><published>2015-01-24T11:09:00.001-08:00</published><updated>2016-01-20T02:31:55.519-08:00</updated><title type='text'>Find length of String without using any length or size method</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
import java.util.Scanner;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public class SB&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
public static void main(String[] args) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;String test;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; Scanner in = new Scanner(System.in);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;For further program please visit my new blog http://javainhouse.blogspot.com&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/5840622506255696083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2015/01/calculate-size-of-string-without-using-builtin-method.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/5840622506255696083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/5840622506255696083'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2015/01/calculate-size-of-string-without-using-builtin-method.html' title='Find length of String without using any length or size method'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</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-4105123969746300472.post-5112866098200686923</id><published>2015-01-24T10:24:00.000-08:00</published><updated>2015-01-24T10:24:09.805-08:00</updated><title type='text'>Print &quot;welcome bangalore&quot; as welcome erolagnab</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
import java.util.Scanner;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public class SB&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
public static void main(String[] args) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; String test=&quot;welcome bangalore&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;String reverse=&quot;&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp;int i=0;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp;String a[]=test.split(&quot; &quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp;for (int j = a[1].length()-1; j &amp;gt;= 0; j--)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; reverse = reverse + a[1].charAt(j);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp;a[1]=reverse;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp;test=a[0] +&quot; &quot;+ a[1];&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp;System.out.println(test);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/5112866098200686923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2015/01/print-welcome-bangalore-as-welcome-erolagnab.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/5112866098200686923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/5112866098200686923'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2015/01/print-welcome-bangalore-as-welcome-erolagnab.html' title='Print &quot;welcome bangalore&quot; as welcome erolagnab'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</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-4105123969746300472.post-404057495027876633</id><published>2015-01-22T10:54:00.000-08:00</published><updated>2015-01-24T06:02:51.757-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="java coding"/><category scheme="http://www.blogger.com/atom/ns#" term="java programs"/><category scheme="http://www.blogger.com/atom/ns#" term="palindrome"/><category scheme="http://www.blogger.com/atom/ns#" term="String"/><title type='text'>Program in java to check whether a String is palindrome or not </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
import java.util.*;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;public class Palindrome&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;{&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; public static void main(String args[])&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;String original, reverse = &quot;&quot;;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;Scanner in = new Scanner(System.in);&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;

&lt;title&gt;Program in java to check whether a String is palindrome or not &lt;/title&gt;
&lt;meta description=&quot;Program in java to check whether a String is palindrome or not &quot;/&gt; 
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.println(&quot;Enter a string to check palindrome&quot;);&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;original = in.nextLine();&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;int length = original.length();&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;for ( int i = length - 1 ; i &amp;gt;= 0 ; i-- )&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; reverse = reverse + original.charAt(i);&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;if(reverse.equals(original))&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.println(&quot;Yes String is palindrome&quot;);&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;else&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp;System.out.println(&quot;NO String is not palindrome&quot;);&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/404057495027876633/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2015/01/program-in-java-to-check-whether-string-is-palindrome-or-not.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/404057495027876633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/404057495027876633'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2015/01/program-in-java-to-check-whether-string-is-palindrome-or-not.html' title='Program in java to check whether a String is palindrome or not '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</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-4105123969746300472.post-5790622512650894232</id><published>2015-01-22T10:48:00.000-08:00</published><updated>2015-01-24T06:04:08.017-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="java programs"/><category scheme="http://www.blogger.com/atom/ns#" term="split"/><category scheme="http://www.blogger.com/atom/ns#" term="String"/><title type='text'>Program to split a String without using split() method</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;title&gt;Program to split a String without using split() method&lt;/title&gt;
&lt;meta description=&quot;Program to split a String without using split() method&quot;/&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;import java.util.*;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public class SplitString&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;public static void main(String[] args) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp;String[] s = {&quot;Netherlands_Iceland_Norway_Denmark&quot;};&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp;String[] finalString = mymethod(s); &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp;for (int i = 0; i &amp;lt; s.length; i++) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.println(&quot;&quot; + finalString[i]);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;static public String[] mymethod(String[] mystring) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp;String ss[] = new String[mystring.length];&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp;for (int j = 0; j &amp;lt; mystring.length; j++) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ss[j] = mystring[j].replace(&#39;_&#39;, &#39; &#39;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp;return ss;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/5790622512650894232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2015/01/program-to-split-string-without-using-split-method.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/5790622512650894232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/5790622512650894232'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2015/01/program-to-split-string-without-using-split-method.html' title='Program to split a String without using split() method'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</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-4105123969746300472.post-7756911646117551244</id><published>2015-01-19T08:58:00.000-08:00</published><updated>2015-01-24T06:04:36.520-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="JAXB"/><category scheme="http://www.blogger.com/atom/ns#" term="JAXB Architecture"/><category scheme="http://www.blogger.com/atom/ns#" term="JAXB tutorial"/><category scheme="http://www.blogger.com/atom/ns#" term="web service"/><title type='text'>Introduction to JAXB and its Architecture</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;JAXB
means JAVA API for XML Binding.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Introduction to JAXB and its Architecture&lt;/title&gt;
&lt;meta description=&quot;Introduction to JAXB and its Architecture&quot;/&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;In
simple words, it means an API used to bind XML with JAVA objects.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;JAXB
provides an efficient and easy way to bind XML data to JAVA which is very
helpful for java developer ,Mostly used in case of web services as data travel
between web services and client in form of xml which is further needed to be
converted into java object as a need for java application.This need can be
fulfilled by JAXB.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;Mainly
two things can be understood as working of JAXB.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&amp;nbsp;1.&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;Conversion of java objects to XML which
is known as Marshalling.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&amp;nbsp;2.&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;Conversion&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;of XML data to
java object ,known as unmarshalling.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;JAXB Architecture:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT4MM9j1Imbj5TzXUY0qqYodXdXFf_m9-9HMEbDQrI1GS7SS3cOCXm7GJqsox1h_yUAVl_rPn3TpelOBiOC0WjNjIEU4eOKhcDjqDT4yuNEZ4QPNqDQAgNz9KR4C1lTM8xa3PrWavgXRY/s1600/AV8CpG.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT4MM9j1Imbj5TzXUY0qqYodXdXFf_m9-9HMEbDQrI1GS7SS3cOCXm7GJqsox1h_yUAVl_rPn3TpelOBiOC0WjNjIEU4eOKhcDjqDT4yuNEZ4QPNqDQAgNz9KR4C1lTM8xa3PrWavgXRY/s1600/AV8CpG.gif&quot; height=&quot;266&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;JAXB Architecture&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;JAXB
Architecture consists of following components:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;Schema
Compiler &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;Schema
Generator&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;Binding
Runtime Framework&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;Schema
Compiler is used to bind source schema with schema derived program elements.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;Schema
Generator maps set of Program elements to derived schema .This mapping is
described by annotations.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;Binding
Runtime Environment : &lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;Provides unmarshalling (reading)
and marshalling (writing) operations for accessing, manipulating, and
validating XML content using either schema-derived or existing program elements.&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0in;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;ol start=&quot;1&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/7756911646117551244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2015/01/introduction-to-jaxb-and-its-architecture.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/7756911646117551244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/7756911646117551244'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2015/01/introduction-to-jaxb-and-its-architecture.html' title='Introduction to JAXB and its Architecture'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT4MM9j1Imbj5TzXUY0qqYodXdXFf_m9-9HMEbDQrI1GS7SS3cOCXm7GJqsox1h_yUAVl_rPn3TpelOBiOC0WjNjIEU4eOKhcDjqDT4yuNEZ4QPNqDQAgNz9KR4C1lTM8xa3PrWavgXRY/s72-c/AV8CpG.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4105123969746300472.post-9093197241549599813</id><published>2014-12-20T10:22:00.000-08:00</published><updated>2016-07-17T07:09:36.370-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="get in hashmap"/><category scheme="http://www.blogger.com/atom/ns#" term="hashmap"/><category scheme="http://www.blogger.com/atom/ns#" term="hashmap in java"/><category scheme="http://www.blogger.com/atom/ns#" term="put in hashmap"/><title type='text'>How Hashmap works internally in java</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div&gt;
This page has been moved to our new blog &lt;a href=&quot;http://www.javainhouse.com/2016/05/hashmap-internal-working-java.html&quot;&gt;http://www.javainhouse.com/2016/05/hashmap-internal-working-java.html&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/9093197241549599813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2014/12/how-hashmap-works-internally-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/9093197241549599813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/9093197241549599813'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2014/12/how-hashmap-works-internally-in-java.html' title='How Hashmap works internally in java'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</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-4105123969746300472.post-7798379078993278144</id><published>2014-12-10T04:27:00.001-08:00</published><updated>2014-12-19T00:05:07.481-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="=="/><category scheme="http://www.blogger.com/atom/ns#" term="equals()"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="objects"/><category scheme="http://www.blogger.com/atom/ns#" term="wiki"/><title type='text'>Difference between equals() and ==</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;title&gt;Difference between equals() and ==&lt;/title&gt;
&lt;h1&gt;Difference between equals() and ==&lt;/h1&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;Hi all , these days i\&#39;m about to write a post on very fashionable interview question that is what\&#39;s the difference between equals and == .It is asked in every object familiarised language interview whether or not its Java or ASP.NET For this you must apprehend the essential difference between each .&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;1. The very first difference in both is that equals () &amp;nbsp;is a &amp;nbsp;method == is an operator . this can be the terribly basic factor you must understand equals and ==&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;As in java there\&#39;s no concept of operator overloading thus we cannot modify the behavior of == operator.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;2. “= = “operator : “= =” is a binary operator used to compare both primitive sorts like int ,Boolean and objects .&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;While examination primitive sort its works properly and returns right output&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;For example :&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;int a=1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;int b=2;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;if(a==b)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;Output : Not Equal;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;While examination 2 objects using “==” ,a problem arises is that “= =” checks reference of each objects not price and returns output correspondingly .&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;This can be illustrated with the assistance of associate example :&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;String variable1=new String(“First”);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;String variable2=new String(“First);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;If(variable1==variable2)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;Output: Not Equal&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;In the example above as variable1 and variable2 ar referring to 2 totally different objects despite of same price .Accordingly “==” operator can come false compared each&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;String variable1=new String(“First”);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;String variable2=variable1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;If(variable1==variable2)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;Output: Equal&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;In the example above as variable1 and variable2 ar referring to 2 same objects .Accordingly “==” operator can come true compared each&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;3. equals () : &amp;nbsp;equals() method is used to compares the worth of 2 objects . this method is defined in Object class and can even be overridden to change the working&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;String variable1=new String(“First”);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;String variable2=variable1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;If(variable1.equals(variable2))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;Output: Equal&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;In the example above as variable1 and variable2 are referring to 2 totally different objects with same price .Accordingly equals() will come true compared each.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;you may like :&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 18.1818180084229px;&quot;&gt;How objects are stored in heap ?&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/7798379078993278144/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2014/12/difference-between-equals-and-equality-operator-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/7798379078993278144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/7798379078993278144'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2014/12/difference-between-equals-and-equality-operator-java.html' title='Difference between equals() and =='/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</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-4105123969746300472.post-5911438785044293835</id><published>2014-12-07T07:57:00.003-08:00</published><updated>2014-12-19T00:07:34.450-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Checked Exception"/><category scheme="http://www.blogger.com/atom/ns#" term="custom exception"/><category scheme="http://www.blogger.com/atom/ns#" term="exception"/><category scheme="http://www.blogger.com/atom/ns#" term="exception handling"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Types of Exception"/><category scheme="http://www.blogger.com/atom/ns#" term="Unchecked Exception"/><category scheme="http://www.blogger.com/atom/ns#" term="wiki"/><title type='text'>How to create custom Exception in Java</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;title&gt;How to create custom Exception in Java&lt;/title&gt;
&lt;br /&gt;
&lt;h1&gt;
Custom Exception&lt;/h1&gt;
&lt;/div&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;Why we need custom Exception ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;How to create a custom
exception ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;Write code to create a Custom
Exception&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;All these are questions usually
asked in a Java interview .So my today&#39;s post on how to create a custom
exception in java .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;As we know There are two types
of Exception :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;1. Checked Exception&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;2. Unchecked Exception&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;Both these exceptions have a
common parent class Exception .So ,in same order if we have to create a custom
exception ,we need to extend Exception class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;Ok , let me explain the process
step by step .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;1. Any custom exception should
extend Exception Class .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;2.
There should be a proper name given to the Exception ,For example if there is
an exception related to Invalid age name can be given as InvalidAgeException &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 480;&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 6.15in;&quot; valign=&quot;top&quot; width=&quot;590&quot;&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;public
  class InvalidAgeException extends &lt;i&gt;Exception&lt;/i&gt; {}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 480;&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 6.15in;&quot; valign=&quot;top&quot; width=&quot;590&quot;&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;public
  class InvalidAgeException extends &lt;i&gt;Exception&lt;/i&gt; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;private
  int age;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;public
  InvalidAgeException ()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;super();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;InvalidAgeException&lt;span style=&quot;background: white; font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt; (&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;String&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white;&quot;&gt;message,&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;int&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white;&quot;&gt;age) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background: white; font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;{ &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background: white; font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;super(message); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background: white; font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;.&lt;span style=&quot;background: white;&quot;&gt;age&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;=&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white;&quot;&gt;age; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background: white; font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;}&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;In the
above way we can define two constructors of InvalidAgeException with message
and without message&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;Usage
of custom Exception:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;Below
is the program with usage of custom exception.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 480;&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 6.15in;&quot; valign=&quot;top&quot; width=&quot;590&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;class&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;CustomExceptionDemo&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background: white; font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;{&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;static&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;final&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;Map&lt;span style=&quot;background: white;&quot;&gt;&amp;lt;Integer&lt;/span&gt;&lt;span style=&quot;background: white;&quot;&gt;,&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;String&amp;gt;&lt;span style=&quot;background: white;&quot;&gt; employee&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;=&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;new&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;HashMap&lt;span style=&quot;background: white;&quot;&gt;&amp;lt;&amp;gt;();&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;static&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white; font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;{ &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background: white; font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;employee&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;background: white;&quot;&gt;put(&lt;/span&gt;100&lt;span style=&quot;background: white;&quot;&gt;,&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&quot;Mahesh&quot;&lt;span style=&quot;background: white;&quot;&gt;); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background: white; font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;employee&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;background: white;&quot;&gt;put(&lt;/span&gt;101&lt;span style=&quot;background: white;&quot;&gt;,&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&quot;&lt;span id=&quot;IL_AD2&quot; style=&quot;background-attachment: scroll; background-clip: initial !important; background-origin: initial !important; background-position-x: 0%; background-position-y: 50%; background-size: initial !important; cursor: pointer !important; float: none;&quot;&gt;&lt;span class=&quot;ilad&quot;&gt;Suresh&lt;/span&gt;&quot;&lt;/span&gt;&lt;span style=&quot;background: white;&quot;&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background: white; font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;&amp;nbsp;employee&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;background: white;&quot;&gt;put(&lt;/span&gt;102&lt;span style=&quot;background: white;&quot;&gt;,&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&quot;Bran&quot;&lt;span style=&quot;background: white;&quot;&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background: white; font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;&amp;nbsp;employee&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;background: white;&quot;&gt;put(&lt;/span&gt;103&lt;span style=&quot;background: white;&quot;&gt;,&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&quot;Troy&quot;&lt;span style=&quot;background: white;&quot;&gt;); }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white; font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;public&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;static&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;void&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;main&lt;span style=&quot;background: white;&quot;&gt;(&lt;/span&gt;String&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white;&quot;&gt;args[])
  {&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;CustomExceptionDemo&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white;&quot;&gt;t&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;=&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;new&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;CustomExceptionDemo&lt;span style=&quot;background: white;&quot;&gt;(); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background: white; font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;.&lt;span style=&quot;background: white;&quot;&gt;getAge(&lt;/span&gt;1000&lt;span style=&quot;background: white;&quot;&gt;); }&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;String getAge&lt;span style=&quot;background: white;&quot;&gt;(&lt;/span&gt;int&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white;&quot;&gt;age)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background: white; font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;&amp;nbsp;{&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white;&quot;&gt;(employee&lt;/span&gt;.&lt;/span&gt;&lt;span style=&quot;background: white;&quot;&gt;get(age)&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;==&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;null&lt;span style=&quot;background: white;&quot;&gt;) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background: white; font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;{&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;throw&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;new InvalidAgeException&lt;span style=&quot;background: white;&quot;&gt; (&lt;/span&gt;&quot;No such employee exists&quot;&lt;span style=&quot;background: white;&quot;&gt;, age); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background: white; font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;}&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;return&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white;&quot;&gt;employee&lt;/span&gt;.&lt;/span&gt;&lt;span style=&quot;background: white;&quot;&gt;get(name); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background: white; font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;} &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background: white; font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: 13.5pt;&quot;&gt;&lt;br /&gt;
  &lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;br /&gt;
  &lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br /&gt;
  &lt;!--[endif]--&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
SO friends this was my post on Custom Exception .&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/5911438785044293835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2014/12/how-to-create-custom-exception-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/5911438785044293835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/5911438785044293835'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2014/12/how-to-create-custom-exception-in-java.html' title='How to create custom Exception in Java'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</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-4105123969746300472.post-2074936546094825018</id><published>2014-11-30T22:14:00.001-08:00</published><updated>2014-12-19T00:08:40.347-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="design pattern"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="wiki"/><title type='text'>What is design pattern in java?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;title&gt;design pattern in java&lt;/title&gt;
&lt;h1&gt;
&lt;b&gt;Design Pattern &amp;nbsp;:&lt;/b&gt;&lt;/h1&gt;&lt;br /&gt;
&lt;br /&gt;
Design pattern are &amp;nbsp;answer to common occurring problem in software system development . Design pattern are language independent solution that are developed to solve common object oriented issues .&lt;br /&gt;
They if used sensibly helps to extend code maintainability , reduces learning curve whereas developing a bit of code ,makes development quicker ,reduces TCO (total value &amp;nbsp;output) and helps to simply understand solution to new developer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Singleton Design Pattern :&lt;/b&gt;&lt;br /&gt;
Singleton Design pattern uses a singleton class which should have a single instance.&lt;br /&gt;
Singleton design pattern ensures that at a single point of time only a single instance should be present in JVM Singleton class should also provide a method which acts as a single point for global access of that class.&lt;br /&gt;
&lt;br /&gt;
Common approach for a singleton pattern :&lt;br /&gt;
1. Singleton class should have a private constructor so that no other class can instantiate it .&lt;br /&gt;
2. Singleton class should have a private static variable of the class that will be the only instance of that class.&lt;br /&gt;
3. A public static method which is the only global access point for outer world.&lt;br /&gt;
&lt;br /&gt;
You may like :&lt;br /&gt;
&lt;a href=&quot;http://javatutorialhere.blogspot.com/2014/12/difference-between-equals-and-equality-operator-java.html&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;Difference&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; between equals() and = =&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/2074936546094825018/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2014/11/what-is-design-pattern-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/2074936546094825018'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/2074936546094825018'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2014/11/what-is-design-pattern-in-java.html' title='What is design pattern in java?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</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-4105123969746300472.post-7873935588463092930</id><published>2014-11-30T11:06:00.000-08:00</published><updated>2014-11-30T11:06:05.641-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Count the Number of Vowels in Java String"/><title type='text'>Count the Number of Vowels in Java String</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
import java.util.Scanner;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public class SB&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
public static void main(String[] args) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;String test=null;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;int j=0;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp;char index[]={&#39;a&#39;,&#39;e&#39;,&#39;i&#39;,&#39;o&#39;,&#39;u&#39;};&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;System.out.println(&quot;Enter the string&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;test= new Scanner(System.in).nextLine();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;for (int i = 0; i &amp;lt; test.length(); i++)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;for (int k = 0; k &amp;lt; &amp;nbsp;index.length; k++)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;char element=test.charAt(i);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;if(element == index[k])&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;j++;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;System.out.println(&quot;No of vowels are &quot;+j);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/7873935588463092930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2014/11/Count-the-Number-of-Vowels-in-Java-String.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/7873935588463092930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/7873935588463092930'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2014/11/Count-the-Number-of-Vowels-in-Java-String.html' title='Count the Number of Vowels in Java String'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</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-4105123969746300472.post-5446485260744292694</id><published>2014-11-30T09:40:00.000-08:00</published><updated>2014-11-30T09:40:31.328-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="count substring"/><title type='text'>find the substring count from a string without string functions in java</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
import java.util.HashMap;&lt;br /&gt;
import java.util.Iterator;&lt;br /&gt;
import java.util.Map;&lt;br /&gt;
import java.util.Scanner;&lt;br /&gt;
import java.util.Set;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public class SB&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public static void main(String[] args) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;String test=null;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;String index=null;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;int j=0;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;System.out.println(&quot;Enter the string&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;test= new Scanner(System.in).nextLine();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;System.out.println(&quot;Enter the substring you want to count&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;index= new Scanner(System.in).nextLine();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;for (int i = 0; i &amp;lt;= test.length()-index.length(); i++) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;String testing=test.substring(i, index.length()+i);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;if(testing.equals(index))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;j++;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;System.out.println(&quot;No of count is &quot;+j);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/5446485260744292694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2014/11/find-substring-count-from-string.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/5446485260744292694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/5446485260744292694'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2014/11/find-substring-count-from-string.html' title='find the substring count from a string without string functions in java'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</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-4105123969746300472.post-5373664711692753873</id><published>2014-11-30T00:57:00.000-08:00</published><updated>2014-12-10T04:31:00.446-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Program to remove a particular character from a sentence"/><title type='text'>Program to remove a particular character from a sentence </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;br /&gt;
&lt;br /&gt;
public class SB&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public static void main(String[] args) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;String test=null;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;char remove = 0;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;System.out.println(&quot;Enter the String&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;test = new Scanner(System.in).nextLine();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;System.out.println(&quot;Enter the Character to be removed&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;remove=new Scanner(System.in).nextLine().charAt(0);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;StringBuilder newstring =new StringBuilder();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;for (int i = 0; i &amp;lt; test.length(); i++) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;if(remove==test.charAt(i))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;continue;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;newstring.append(test.charAt(i));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;System.out.println(newstring);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  You may like :&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://javatutorialhere.blogspot.com/2014/12/difference-between-equals-and-equality-operator-java.html&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;Difference&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; between equals() and = =&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://javatutorialhere.blogspot.com/2014/11/what-is-design-pattern-in-java.html&quot;&gt;&lt;b&gt;Singleton Design Pattern&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://javatutorialhere.blogspot.in/2014/11/java-programs-for-interview.html&quot;&gt;Other Programs in Java&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://javatutorialhere.blogspot.in/2014/12/how-to-create-custom-exception-in-java.html&quot;&gt;Custom Exception in Java -Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/5373664711692753873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2014/11/program-to-remove-particular-character-from-sentence.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/5373664711692753873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/5373664711692753873'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2014/11/program-to-remove-particular-character-from-sentence.html' title='Program to remove a particular character from a sentence '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</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-4105123969746300472.post-6299197593470997693</id><published>2014-11-29T01:06:00.000-08:00</published><updated>2016-01-20T02:33:41.796-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="prime number"/><category scheme="http://www.blogger.com/atom/ns#" term="Program to find a prime number in java"/><title type='text'>Program to find a prime number in java</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
import java.util.Scanner;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public class SB&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public static void main(String[] args) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.out.println(&quot;Enter the limit uptoo which you want to print prime no.&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;int in = new Scanner(System.in).nextInt();&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;int limit =in;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;for (int i = 2; i &amp;lt;=limit; i++) {&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;nbsp;For further visit &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://javainhouse.blogspot.in/&quot; target=&quot;_blank&quot;&gt;Javainhouse&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
You may like :&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://javatutorialhere.blogspot.com/2014/11/what-is-design-pattern-in-java.html&quot;&gt;Design Pattern in &amp;nbsp;java&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://javatutorialhere.blogspot.com/2014/11/java-programs-for-interview.html&quot;&gt;Java Coding Interview Questions&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/6299197593470997693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2014/11/program-to-find-prime-number-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/6299197593470997693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/6299197593470997693'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2014/11/program-to-find-prime-number-in-java.html' title='Program to find a prime number in java'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</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-4105123969746300472.post-6509623034908815707</id><published>2014-11-27T11:55:00.000-08:00</published><updated>2014-11-27T11:55:35.653-08:00</updated><title type='text'>Count no.of times a word repeats in String 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;
public class SB&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public static void main(String[] args) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String test=&quot;Hi I am here am am too good am very a m&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String find=&quot;am&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;int i=0;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String a[]=test.split(&quot; &quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;for (int j = 0; j &amp;lt; a.length; j++) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if(a[j].equals(find))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;i++;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;System.out.println(i);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
}&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/6509623034908815707/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2014/11/count-number-of-times-word-repeats-in-string-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/6509623034908815707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/6509623034908815707'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2014/11/count-number-of-times-word-repeats-in-string-in-java.html' title='Count no.of times a word repeats in String in Java'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</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-4105123969746300472.post-5204446057719122810</id><published>2014-11-27T11:42:00.000-08:00</published><updated>2014-11-27T11:42:16.779-08:00</updated><title type='text'>Program in java to find a String in a sentence</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Hi all&lt;br /&gt;
I am writing a program to find whether a particular word exists in a sentence or not .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public class SB&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public static void main(String[] args) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String test=&quot;Hi I am here&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String find=&quot;am&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;if(test.indexOf(find)&amp;gt;0)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;System.out.println(&quot;found &quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;else&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;System.out.println(&quot;not found&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
output: found&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public class SB&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public static void main(String[] args) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String test=&quot;Hi I am here&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String find=&quot;kill&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;if(test.indexOf(find)&amp;gt;0)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;System.out.println(&quot;found am&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;else&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;System.out.println(&quot;not found&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
output : not found&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/5204446057719122810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2014/11/program-in-java-to-find-string-in-a-sentecnce.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/5204446057719122810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/5204446057719122810'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2014/11/program-in-java-to-find-string-in-a-sentecnce.html' title='Program in java to find a String in a sentence'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</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-4105123969746300472.post-7169335155520374445</id><published>2014-11-25T01:27:00.001-08:00</published><updated>2014-11-27T05:02:51.779-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="collections"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Top Java Collections interview Questions</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;1.What is Java Collection Framework?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Ans : Java Collections Framework is also known as JCF. It is a set of classes and Interfaces that implement commonly used data structures like List ,Linked List etc.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;2. Explain Collection Framework in detail or what all collections are present in Java Collection Framework ?&lt;/b&gt;&lt;br /&gt;
Ans : Java Collection Framework architecture consists of many collections Like List,Set ,Map etc . You can find detailed description of this framework &lt;a href=&quot;http://javatutorialhere.blogspot.com/2014/08/java-collections-everything-you-want-to.html&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;3. Why Map interface does not extends Collection interface ?&lt;/b&gt;&lt;br /&gt;
Ans : Map is a part of Collections framework but does not extend Collections Interface as its behaviour is different from normal Collections like List and set :&lt;br /&gt;
The reason that can be tell in an interview that :&lt;br /&gt;
a) Map contains key value pair to store data in it while other collections like list and set directly stores elements in them .&lt;br /&gt;
b) add() method is not used in map to add an element.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;4. What is List interface? What are all its implementations?&lt;/b&gt;&lt;br /&gt;
Ans : List is an ordered collection of elements .The ordering is index based .List can conatin duplicate elements. The implementation of lIst are :&lt;br /&gt;
a) ArrayList&lt;br /&gt;
b) Vector&lt;br /&gt;
c) Linkedist&lt;br /&gt;
d) Stack&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;5. What is an arrayList?&lt;/b&gt;&lt;br /&gt;
Ans :ArrayList is an implementation of List which is backed by an array .ArrayList is re-sizable array implementation of List interface and implements all operations of List interface,permits all elements including null .&lt;br /&gt;
&lt;br /&gt;
eg.&lt;br /&gt;
List&amp;lt;String&amp;gt; l= new ArrayList&amp;lt;String&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
ArrayList&amp;lt;String&amp;gt; l= new ArrayList&amp;lt;String&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;6.Internal Working of an ArrayList&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Ans : Internal working of an ArrayList is very important question with interview perspective .Interviewer asks this question to know how deeply the candidate know about this structure .As you know ArrayList is backed by an array only ,but how this array is defined and how elements are added into this array you can read it in detail&lt;span style=&quot;color: blue;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;&lt;a href=&quot;http://javatutorialhere.blogspot.com/2014/09/internal-working-of-array-list.html&quot;&gt;here &lt;/a&gt;.:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;a href=&quot;http://javatutorialhere.blogspot.com/2014/09/internal-working-of-array-list.html&quot;&gt;Internal Working of an ArrayList&amp;nbsp;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;7. Difference between
Array and arrayList.&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;border-collapse: collapse; border: none; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td style=&quot;border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 239.4pt;&quot; valign=&quot;top&quot; width=&quot;319&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: center;&quot;&gt;
&lt;b&gt;Array&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-left: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-themecolor: text1; mso-border-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 239.4pt;&quot; valign=&quot;top&quot; width=&quot;319&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: center;&quot;&gt;
&lt;b&gt;ArrayList&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 239.4pt;&quot; valign=&quot;top&quot; width=&quot;319&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
Arrays are fixed in size and cannot be resized dynamically&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 239.4pt;&quot; valign=&quot;top&quot; width=&quot;319&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
ArrayList is dynamic and resizablei in nature&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 239.4pt;&quot; valign=&quot;top&quot; width=&quot;319&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; color: #333333; font-family: &amp;quot;Helvetica&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.5pt;&quot;&gt;Once the array is created elements cannot be
  added or deleted from it&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 239.4pt;&quot; valign=&quot;top&quot; width=&quot;319&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; color: #333333; font-family: &amp;quot;Helvetica&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.5pt;&quot;&gt;ArrayList the elements can be added and
  deleted at runtime.&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 239.4pt;&quot; valign=&quot;top&quot; width=&quot;319&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
Can be multidimensional &lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 239.4pt;&quot; valign=&quot;top&quot; width=&quot;319&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
Can’t &amp;nbsp;be multidimensional&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 239.4pt;&quot; valign=&quot;top&quot; width=&quot;319&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; color: #333333; font-family: &amp;quot;Helvetica&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.5pt;&quot;&gt;Array can contain objects of a single data
  type or class&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 239.4pt;&quot; valign=&quot;top&quot; width=&quot;319&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; color: #333333; font-family: &amp;quot;Helvetica&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.5pt;&quot;&gt;ArrayList if not used with generic can
  contain objects of different classes&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 239.4pt;&quot; valign=&quot;top&quot; width=&quot;319&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
Example :&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
Int [] arr={1,2};&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 239.4pt;&quot; valign=&quot;top&quot; width=&quot;319&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
Example :&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
List lis= new ArrayList();&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
lis.add(1);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
lis.add(“John”);&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;8 .How to sort an array list ?&lt;/b&gt;&lt;br /&gt;
Ans : To sorting an array list we can use various techniques .&lt;br /&gt;
&lt;br /&gt;
1. Without using any sort method .&lt;br /&gt;
2. Using sort method&lt;br /&gt;
3. Using Comparator and Comparable&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1. To sort an array List&lt;/b&gt; without using sort method ,we need to use a sorting algorithm .which can be bubble sort&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;2. using sort method&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
To sort an array List using sort method we will use collections.sort&lt;br /&gt;
&lt;br /&gt;
eg. We have an array List&lt;br /&gt;
List l= new ArrayList();&lt;br /&gt;
l.add(123);&lt;br /&gt;
l.add(80);&lt;br /&gt;
l.add(67);&lt;br /&gt;
l.add(12);&lt;br /&gt;
collections.sort(l);&lt;br /&gt;
for (int i :l)&lt;br /&gt;
system.out.println(l);&lt;br /&gt;
&lt;br /&gt;
Output : 12&lt;br /&gt;
67&lt;br /&gt;
80&lt;br /&gt;
123&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;3. Using Comparator and Comparable&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
If you want to sort an arrayList&amp;lt;Object &amp;gt; then we need to use comparable and comparator interface .&lt;br /&gt;
This is very important question to sort collection using comparable and comparator interface .You can find detailed description here .&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;9. What is the order of the elements are stored in an array List ?&lt;/b&gt;&lt;br /&gt;
Ans : The order of the elements stored in arrayList is same they are added to the List .&lt;br /&gt;
For arrayList ,LinkedList,Vector &amp;nbsp;order of the elements stored in arrayList is same they are added to the List .&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;10.What is difference between Arrays.sort() and collections.sort() ?&lt;/b&gt;&lt;br /&gt;
Ans : The main difference between arrays.sort() and collections.sort() is that the former is used to sort arrays and latter is used to sort collections like list .You can further read detailed description on difference between Arrays.sort() and collections.sort() &amp;nbsp;here :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://javatutorialhere.blogspot.com/2014/11/difference-between-arrayssort-and.html&quot;&gt;Difference between Arrays.sort() and collections.sort()&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;11. What is Linked List in Java Collections ?&lt;/b&gt;&lt;br /&gt;
Ans : Linked List is doubly linked list implementation of list interface .Please don&#39;t confuse linked list in collection with linked list in data structure as that one in data structure can be both singly link list or doubly .&lt;br /&gt;
Linked List implements all of the methods of list interface and permits all kind elements including null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/7169335155520374445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2014/11/top-java-collections-interview-questions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/7169335155520374445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/7169335155520374445'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2014/11/top-java-collections-interview-questions.html' title='Top Java Collections interview Questions'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</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-4105123969746300472.post-4289107463073219281</id><published>2014-11-24T03:37:00.001-08:00</published><updated>2014-11-25T01:29:19.712-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="instanceof"/><category scheme="http://www.blogger.com/atom/ns#" term="interview"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="wiki"/><title type='text'>Java Interview Questions </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Q1.&amp;nbsp;&lt;span style=&quot;font-family: Arial;&quot;&gt;How can you get to know that
whether one object belongs to a particular class ?&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Arial;&quot;&gt;Ans : using&lt;b&gt; instanceof&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background: white; color: #4d4e53; font-family: Arial; font-size: 10.5pt;&quot;&gt;The&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style=&quot;border: none windowtext 1.0pt; font-family: Arial; mso-ansi-font-size: 10.5pt; mso-bidi-font-size: 10.5pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;instanceof&lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;operator tests whether an object has
in its prototype chain the&lt;/span&gt;&lt;code&gt;&lt;span style=&quot;border: none windowtext 1.0pt; font-family: Arial; mso-ansi-font-size: 10.5pt; mso-bidi-font-size: 10.5pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;prototype&lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;property
of a constructor.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background: white; color: #4d4e53; font-family: Arial; font-size: 10.5pt;&quot;&gt;Eg :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background: white; color: #4d4e53; font-family: Arial; font-size: 10.5pt;&quot;&gt;We have a class test with a object &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background: white; color: #4d4e53; font-family: Arial; font-size: 10.5pt;&quot;&gt;Test t1= new Test();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background: white; color: #4d4e53; font-family: Arial; font-size: 10.5pt;&quot;&gt;And another class Testing t2 = new Test();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background: white; color: #4d4e53; font-family: Arial; font-size: 10.5pt;&quot;&gt;If we have to find that whether t2 belong to Test class or
not we will use &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background: #EEEEEE; border: solid #D6D6D6 1.0pt; mso-border-alt: solid #D6D6D6 .75pt; mso-element: para-border-div; padding: 4.0pt 4.0pt 4.0pt 4.0pt;&quot;&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; padding: 0in;&quot;&gt;&lt;span class=&quot;typ&quot;&gt;&lt;span style=&quot;color: #7f0055; font-size: 9.0pt;&quot;&gt;System&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&lt;span style=&quot;color: #666600; font-size: 9.0pt;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;&lt;span style=&quot;color: #000088; font-size: 9.0pt;&quot;&gt;out&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&lt;span style=&quot;color: #666600; font-size: 9.0pt;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;println&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&lt;span style=&quot;color: #666600; font-size: 9.0pt;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;t2 &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;&lt;span style=&quot;color: #000088; font-size: 9.0pt;&quot;&gt;instanceof&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;&lt;span style=&quot;color: #7f0055; font-size: 9.0pt;&quot;&gt;Testing&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&lt;span style=&quot;color: #666600; font-size: 9.0pt;&quot;&gt;); //print true&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; padding: 0in;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;&lt;span style=&quot;color: #7f0055; font-size: 9.0pt;&quot;&gt;System&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&lt;span style=&quot;color: #666600; font-size: 9.0pt;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;&lt;span style=&quot;color: #000088; font-size: 9.0pt;&quot;&gt;out&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&lt;span style=&quot;color: #666600; font-size: 9.0pt;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;println&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&lt;span style=&quot;color: #666600; font-size: 9.0pt;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;t2 &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;&lt;span style=&quot;color: #000088; font-size: 9.0pt;&quot;&gt;instanceof&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;&lt;span style=&quot;color: #7f0055; font-size: 9.0pt;&quot;&gt;Test&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&lt;span style=&quot;color: #666600; font-size: 9.0pt;&quot;&gt;); //printfalse&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; padding: 0in;&quot;&gt;&lt;span class=&quot;pun&quot;&gt;&lt;span style=&quot;color: #666600; font-size: 9.0pt;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; padding: 0in;&quot;&gt;&lt;span class=&quot;pun&quot;&gt;&lt;span style=&quot;color: #666600; font-size: 9.0pt;&quot;&gt;&lt;a href=&quot;http://javatutorialhere.blogspot.com/2014/11/top-java-collections-interview-questions.html&quot;&gt;Java Collections Interview Questions&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/4289107463073219281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2014/11/java-interview-questions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/4289107463073219281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/4289107463073219281'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2014/11/java-interview-questions.html' title='Java Interview Questions '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</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-4105123969746300472.post-5832049687388324910</id><published>2014-11-23T04:21:00.001-08:00</published><updated>2014-11-24T03:42:59.167-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Life cycle of a thread in java"/><category scheme="http://www.blogger.com/atom/ns#" term="multithreading"/><category scheme="http://www.blogger.com/atom/ns#" term="thread"/><category scheme="http://www.blogger.com/atom/ns#" term="thread in java"/><title type='text'>Life cycle of a thread in java</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;title&gt;Life cycle of a thread in java&lt;/title&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Life cycle of a thread contains following stages :&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNoSpacing&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;New &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNoSpacing&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Runnable &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNoSpacing&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Running&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNoSpacing&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Blocked or Non running&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNoSpacing&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Terminated&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNoSpacing&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;Release 5.0 introduced the&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white;&quot;&gt;Thread.getState&lt;/code&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;method. When called on a thread, one of the following&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white;&quot;&gt;Thread.State&lt;/code&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;values is returned:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;background-color: white;&quot;&gt;
&lt;li&gt;&lt;code&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;NEW&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;RUNNABLE&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;BLOCKED&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;WAITING&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;TIMED_WAITING&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;TERMINATED&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNoSpacing&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNoSpacing&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;New : State of Thread before start() method .&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNoSpacing&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNoSpacing&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Runnable : A thread is in running state after invocation
of start() method but has not yet selected by scheduler .&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNoSpacing&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNoSpacing&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Running : After Scheduler select the thread to run and
run() method starts executing then that thread it comes in running state.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNoSpacing&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNoSpacing&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Blocked or NonRunning : when a thread goes into wait() or
sleep state then its called to be in non running or blocked .It comes into
runnable state only if notify or notifyAll() is called on that thread.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNoSpacing&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNoSpacing&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Terminated : after a thread is being stopped by stop ()
method ,it comes into terminated state and can never go back to runnable or
running state .&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNoSpacing&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNoSpacing&quot;&gt;
You may like :&lt;br /&gt;
&lt;a href=&quot;http://javatutorialhere.blogspot.com/2014/11/java-interview-questions.html&quot;&gt;Java Interview Questions&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javatutorialhere.blogspot.com/feeds/5832049687388324910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javatutorialhere.blogspot.com/2014/11/life-cycle-of-thread-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/5832049687388324910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4105123969746300472/posts/default/5832049687388324910'/><link rel='alternate' type='text/html' href='http://javatutorialhere.blogspot.com/2014/11/life-cycle-of-thread-in-java.html' title='Life cycle of a thread in java'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09939173891560097583</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>