<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" 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" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;C0UEQXg8cCp7ImA9WhBbFE4.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284</id><updated>2013-05-13T13:16:40.678+05:30</updated><category term="Struts2" /><category term="Static Typing" /><category term="checked and unchecked exceptions" /><category term="Multi Catch" /><category term="isIdentical" /><category term="interfaces all cases" /><category term="String" /><category term="interfaces" /><category term="IDE(s)" /><category term="database locking" /><category term="sleep method" /><category term="Job" /><category term="java threads" /><category term="enterprise beans" /><category term="Automation Tools" /><category term="Lower Case" /><category term="hashmap" /><category term="Tips to clear SCJP exam" /><category term="verbose" /><category term="Analysis and Design" /><category term="Apache" /><category term="method overriding" /><category term="Java Enterprise Frameworks" /><category term="SingleThreadModel" /><category term="variables" /><category term="Dynamic Typing" /><category term="sort" /><category term="Struts" /><category term="weblogic application server" /><category term="XSL" /><category term="Javascript" /><category term="ActionServlet" /><category term="Employment" /><category term="Web technologies" /><category term="Trim Space" /><category term="int" /><category term="substring" /><category term="Type Conversion" /><category term="java questions" /><category term="all tips" /><category term="Java Verbose" /><category term="Garbage Collection" /><category term="mergesort" /><category term="ConcurrentModificationException" /><category term="ejbstore" /><category term="J2EE" /><category term="final class in java" /><category term="Meta" /><category term="Capital Characters" /><category term="Worker Threads" /><category term="isolation levels" /><category term="Deep" /><category term="DTO" /><category term="Interview" /><category term="Strings" /><category term="cohesion" /><category term="application server" /><category term="javac compilation" /><category term="design pattern" /><category term="comparable and comparator interface" /><category term="Profiler" /><category term="stored procedure vs EJB" /><category term="J2EE design patterns" /><category term="Web developer" /><category term="Framework" /><category term="Annotation" /><category term="java framework" /><category term="Deploy" /><category term="Favourite Java IDE(s) poll" /><category term="Servlet" /><category term="Inheritance" /><category term="order of execution of static and non-static blocks" /><category term="loading java class" /><category term="Daemon Threads" /><category term="transaction" /><category term="finally" /><category term="Business Delegate" /><category term="ejb-jar.xml" /><category term="main" /><category term="SCWCD after SCJP" /><category term="static blocks" /><category term="parse" /><category term="Boolean" /><category term="session beans" /><category term="properties" /><category term="regex" /><category term="Java Practice Exams" /><category term="literals" /><category term="Concatenate Operation" /><category term="Compare Contents" /><category term="Difference between EJB3 and EJB2" /><category term="Javadoc" /><category term="ANT" /><category term="Comparator interface" /><category term="Getting Around a Techincal Debate" /><category term="Best Java Websites" /><category term="Eclipse IDE" /><category term="equals" /><category term="SCJP 1.4 Study Notes" /><category term="Split" /><category term="Double" /><category term="SCJP exam" /><category term="SCJP 1.4 mock exam" /><category term="Starting up" /><category term="documentation" /><category term="Comparable Interface" /><category term="Shallow Cloning" /><category term="network trips" /><category term="PL/SQL" /><category term="Java SDK" /><category term="java objects" /><category term="single dimensional" /><category term="HTTP" /><category term="Production Java" /><category term="lastIndexOf" /><category term="session facade pattern" /><category term="Refresh" /><category term="Error" /><category term="java access modifiers" /><category term="DAO" /><category term="Servlet Container" /><category term="Java Code" /><category term="EJB2.0" /><category term="Interview questions" /><category term="Java Language" /><category term="arrays" /><category term="Sun Microsystems" /><category term="URL" /><category term="XML" /><category term="Big O Notation" /><category term="LDAP" /><category term="RESTful" /><category term="web development interview questions" /><category term="Learning" /><category term="portability" /><category term="Count" /><category term="equals()" /><category term="Third Party API" /><category term="PreparedStatement" /><category term="Dynamic" /><category term="Cloning" /><category term="final" /><category term="regular expressions" /><category term="inheritance in java" /><category term="Static method hiding" /><category term="Code Comments" /><category term="Packaged" /><category term="java enviornment variables" /><category term="ACID properties" /><category term="Java Web Services" /><category term="inner class" /><category term="java locale object" /><category term="Flyweight design pattern" /><category term="jdbc" /><category term="MVC" /><category term="HttpSession" /><category term="SQL PL/SQL" /><category term="ListIterator" /><category term="java marker interface" /><category term="java source file name" /><category term="this()" /><category term="BMP" /><category term="is-a and has-a relationship" /><category term="Reader" /><category term="AJAX" /><category term="Control Flow Statements" /><category term="java thread scheduling" /><category term="Fina" /><category term="HttpServlet" /><category term="MyEclipse" /><category term="ANY/Maven" /><category term="notify()" /><category term="EJB QL" /><category term="main method" /><category term="JUnit" /><category term="JCPOCP" /><category term="BufferedReader" /><category term="Java Language Basics - Classes" /><category term="multiple options in SCJP" /><category term="Unit Testing" /><category term="Application" /><category term="TYPE_SCROLL_INSENSITIVE" /><category term="Wrapper classes" /><category term="cyclic inheritance" /><category term="JVM" /><category term="create method" /><category term="Date Formatting in Java" /><category term="reflection API" /><category term="String literals" /><category term="Java Inheritance" /><category term="Custom Exceptions" /><category term="Library" /><category term="synchronized" /><category term="Java" /><category term="Search" /><category term="Java I/O" /><category term="API" /><category term="Widening beats Autoboxing" /><category term="constructor" /><category term="tags" /><category term="Chained Exceptions" /><category term="Writer classes" /><category term="Transaction attributes" /><category term="Online Java Compiler" /><category term="fine grained EJB" /><category term="StringBuilder" /><category term="Struts 2" /><category term="keywords" /><category term="Object Oriented" /><category term="CXF" /><category term="SCWCD" /><category term="JEE application development" /><category term="FAQ" /><category term="Performance" /><category term="Strings in Java" /><category term="Enterprise Java" /><category term="ArrayList" /><category term="production" /><category term="hashcode" /><category term="EJB passivation" /><category term="argument" /><category term="Hash based collections" /><category term="java container" /><category term="Upper Case" /><category term="war" /><category term="java immutable" /><category term="Distributable application" /><category term="array" /><category term="SCJP 1.5" /><category term="EJB" /><category term="set" /><category term="locks" /><category term="Java Developers" /><category term="Java IDE(s)" /><category term="Java Compiler" /><category term="Idempotent" /><category term="overloading and autoboxing" /><category term="SCJP 1.6" /><category term="statelss session bean" /><category term="Deep Cloning" /><category term="JEE" /><category term="difference between abstract class and interfaces" /><category term="Web Server" /><category term="threadsafe" /><category term="java strings" /><category term="SCJP 1.4 brain dumps" /><category term="Java EE" /><category term="TYPE_FORWARD_ONLY" /><category term="XSLT process" /><category term="CONCUR_UPDATABLE" /><category term="Design" /><category term="multidimensional" /><category term="StringBuffer" /><category term="Session" /><category term="Marker" /><category term="getRollbackOnly" /><category term="designs" /><category term="finally block" /><category term="SCJP 1.4" /><category term="Unable to load default ProjectHelper due to java.lang.NoClassDefFoundError: org/xml/sax/SAXException" /><category term="multiple inheritance" /><category term="Methods" /><category term="error page" /><category term="Eclipse" /><category term="parsing XML documents" /><category term="Multithreading" /><category term="primitives" /><category term="Exploded" /><category term="Commands" /><category term="==" /><category term="Tips to use boolean variables in Java" /><category term="Java Beans" /><category term="concat" /><category term="Threads" /><category term="Tutorial" /><category term="Oracle" /><category term="IDE" /><category term="Data Type" /><category term="SAX API" /><category term="Beans" /><category term="Thread pool" /><category term="request object" /><category term="UnavailableException" /><category term="OOPS" /><category term="overloading" /><category term="Conditional GET requests" /><category term="java hashmap" /><category term="Shallow" /><category term="custom taglibs" /><category term="Top Java Blogs" /><category term="setRollbackonly" /><category term="append" /><category term="coupling" /><category term="Declaring constants in Java J2EE applications" /><category term="java final" /><category term="Annotations" /><category term="wait()" /><category term="persistent storage" /><category term="CMP" /><category term="DLL hell" /><category term="replace" /><category term="Reflection" /><category term="exceptions in java" /><category term="NullPointerException" /><category term="CONCUR_READ_ONLY" /><category term="Java Serialization" /><category term="servlets" /><category term="replaceAll" /><category term="java tag interface" /><category term="server" /><category term="exception" /><category term="class level lock" /><category term="Rewriting" /><category term="Nested Inner Classes" /><category term="Special Characters" /><category term="java exceptions" /><category term="strongly/weakly typed languages" /><category term="Core java" /><category term="SQL" /><category term="JSP" /><category term="Integer" /><category term="Encoding" /><category term="Stored Procedure" /><category term="singleton" /><category term="finalize" /><category term="Hibernate" /><category term="Java Inner Classes" /><category term="Iteraro" /><category term="Reports using XSL" /><category term="synchronization in java" /><category term="notigyAll()" /><category term="jar" /><category term="Web" /><category term="Collections" /><category term="JDK 7" /><category term="coarse grained EJB" /><category term="Float" /><category term="business logic" /><category term="instance level lock" /><category term="Iterate ArrayList" /><category term="XML Hell" /><category term="Default values" /><category term="Object creation in Java" /><category term="Constants" /><category term="XSLT" /><category term="scalability" /><category term="hashtable" /><category term="Web Services" /><category term="custome MVC" /><category term="Auto-Unboxing" /><category term="Java interview" /><category term="ear" /><category term="java differences between HashMap and Hashtable" /><category term="resultset" /><category term="entity beans" /><category term="differences between HashMap and Hashtable" /><category term="JEE design patterns" /><category term="Classes" /><category term="Programming Hell" /><category term="scopes" /><category term="JDK" /><category term="Autoboxing" /><category term="Web application" /><category term="HTML" /><category term="Java Collections" /><category term="Delegation" /><category term="Widening and Autoboxing" /><category term="Date Conversion" /><category term="Java/J2EE application development" /><category term="MetaData" /><category term="String class" /><category term="arrays equals operator" /><category term="Object-Oriented Programming" /><category term="Swap Variables in Java" /><category term="Better Java Application Design" /><category term="Java Cloning" /><category term="Sample Java Program" /><category term="ByteCode" /><category term="remove method" /><category term="instance variables" /><category term="SCJP links" /><category term="SCJP" /><category term="Include" /><category term="EJBContext" /><category term="Interface" /><category term="Jar Hell" /><category term="Programming" /><category term="Garbage Collector" /><category term="diamond problem with multiple inheritance" /><category term="hashcode and equals contract" /><category term="DOM API" /><category term="Programmer" /><category term="ejbload" /><category term="yield method" /><category term="variable initializations" /><category term="Project Coin" /><category term="EJB3.0" /><category term="Spring" /><category term="Overloading rules in Java" /><category term="String tokens" /><category term="multiple inheritance with Java" /><category term="Packages" /><category term="database" /><category term="JDK SimpleDateFormat" /><category term="String Case" /><category term="JBoss" /><category term="Object Class" /><category term="Difference between iterator and listiterator" /><category term="servlet interview questions" /><category term="String and StringBuffer" /><category term="REST" /><category term="static" /><category term="Finalize() method" /><category term="Service locator" /><category term="java some tips" /><category term="Source Code" /><category term="static and non static blocks in java" /><category term="compare method" /><category term="Attributes" /><category term="ejbcreate method" /><category term="Code Tools" /><category term="Long" /><category term="Identifiers" /><category term="25 Interview Questions" /><category term="String vs StringBuffer" /><category term="stateful session bean" /><category term="TYPE_SCROLL_SENSITIVE" /><category term="SCJP 1.4 or 1.5" /><category term="StringTokenizer" /><category term="Initialize String Array in Java" /><category term="Character" /><category term="abstract classes" /><category term="Java class loading" /><title>Extreme Java</title><subtitle type="html">A place for Extreme Java JEE developers to read latest Java tutorials. The Extreme Java blog is for Java application development, J2EE application development and web technologies in the Java world.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://extreme-java.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>274</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/ExtremeJava" /><feedburner:info uri="extremejava" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><link rel="license" type="text/html" href="http://creativecommons.org/licenses/by/3.0/" /><logo>http://creativecommons.org/images/public/somerights20.gif</logo><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FExtremeJava" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FExtremeJava" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2FExtremeJava" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/ExtremeJava" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FExtremeJava" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FExtremeJava" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FExtremeJava" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.plusmo.com/add?url=http%3A%2F%2Ffeeds.feedburner.com%2FExtremeJava" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare href="http://www.thefreedictionary.com/_/hp/AddRSS.aspx?http%3A%2F%2Ffeeds.feedburner.com%2FExtremeJava" src="http://img.tfd.com/hp/addToTheFreeDictionary.gif">Subscribe with The Free Dictionary</feedburner:feedFlare><feedburner:feedFlare href="http://www.bitty.com/manual/?contenttype=rssfeed&amp;contentvalue=http%3A%2F%2Ffeeds.feedburner.com%2FExtremeJava" src="http://www.bitty.com/img/bittychicklet_91x17.gif">Subscribe with Bitty Browser</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2FExtremeJava" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://mix.excite.eu/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FExtremeJava" src="http://image.excite.co.uk/mix/addtomix.gif">Subscribe with Excite MIX</feedburner:feedFlare><feedburner:feedFlare href="http://www.webwag.com/wwgthis.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FExtremeJava" src="http://www.webwag.com/images/wwgthis.gif">Subscribe with Webwag</feedburner:feedFlare><feedburner:feedFlare href="http://www.podcastready.com/oneclick_bookmark.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FExtremeJava" src="http://www.podcastready.com/images/podcastready_button.gif">Subscribe with Podcast Ready</feedburner:feedFlare><feedburner:feedFlare href="http://www.wikio.com/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2FExtremeJava" src="http://www.wikio.com/shared/img/add2wikio.gif">Subscribe with Wikio</feedburner:feedFlare><feedburner:feedFlare href="http://www.dailyrotation.com/index.php?feed=http%3A%2F%2Ffeeds.feedburner.com%2FExtremeJava" src="http://www.dailyrotation.com/rss-dr2.gif">Subscribe with Daily Rotation</feedburner:feedFlare><entry gd:etag="W/&quot;DUMMRXg-fCp7ImA9WhNXEUs.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-4341186803736250327</id><published>2012-11-29T11:08:00.000+05:30</published><updated>2012-11-29T11:08:04.654+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-11-29T11:08:04.654+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="verbose" /><title>How to use Verbose options in Java</title><summary type="html">When running a Java program, verbose options can be used to tell the JVM which kind of information to see. JVM suports three verbose options out of the box. As the name suggests, verbose is for displaying the work done by JVM. Mostly the information provided by these parameters is used for debugging purposes. Since it is used for debugging, its use is in development. One would never have to use &lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/J5EfL_v9Hyg" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/4341186803736250327/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/11/how-to-use-verbose-options-in-java.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/4341186803736250327?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/4341186803736250327?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/J5EfL_v9Hyg/how-to-use-verbose-options-in-java.html" title="How to use Verbose options in Java" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/11/how-to-use-verbose-options-in-java.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0cESXY8fCp7ImA9WhNQEkg.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-5118754601404170948</id><published>2012-11-18T22:44:00.001+05:30</published><updated>2012-11-18T22:46:48.874+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-11-18T22:46:48.874+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="equals" /><category scheme="http://www.blogger.com/atom/ns#" term="String" /><title>How String equals method works</title><summary type="html">equals method is declared in Object class and hence is inherited by all classes in Java. The purpose of equals method is to provide logical equality. The default implementation of equals method is:

public boolean equals(Object obj) {
return (this == obj);
}
Thus the default behavior of equals method is same as == operator. 

equals method in String class checks if the two strings have same &lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/8g5yQU1iLR8" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/5118754601404170948/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/11/how-string-equals-method-works.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/5118754601404170948?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/5118754601404170948?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/8g5yQU1iLR8/how-string-equals-method-works.html" title="How String equals method works" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/11/how-string-equals-method-works.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEQNQX0yeyp7ImA9WhNRFU4.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-3008835222836178287</id><published>2012-11-10T12:56:00.000+05:30</published><updated>2012-11-10T12:56:30.393+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-11-10T12:56:30.393+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Data Type" /><category scheme="http://www.blogger.com/atom/ns#" term="Core java" /><title>Overflow And Underflow of data types in Java</title><summary type="html">Overflow and underflow of values of various data types is a very common occurence in Java programs. This is usually because the beginners dont' pay proper attention to the default values of various data types. If we are creating a byte type variable and assigning it a value, we should be aware that the value will be treated as an int and hence a potential overflow condition.
In Java the overflow &lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/NctFSd4KPHE" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/3008835222836178287/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/11/overflow-and-underflow-of-data-types-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/3008835222836178287?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/3008835222836178287?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/NctFSd4KPHE/overflow-and-underflow-of-data-types-in.html" title="Overflow And Underflow of data types in Java" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/11/overflow-and-underflow-of-data-types-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE8DRnw6eCp7ImA9WhJQGU8.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-4731850227618351460</id><published>2012-07-15T20:38:00.000+05:30</published><updated>2012-08-02T22:31:17.210+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-08-02T22:31:17.210+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="hashmap" /><category scheme="http://www.blogger.com/atom/ns#" term="Collections" /><category scheme="http://www.blogger.com/atom/ns#" term="hashcode" /><category scheme="http://www.blogger.com/atom/ns#" term="equals" /><title>Java HashMap Working</title><summary type="html">


Hash based collections in Java work on same concepts. There are a few things to keep in mind when working with them. The details listed in this article will help you to make your programs efficient and easy to maintain. I will describe the internal details of HashMap followed by some tips. Though I am choosing HashMap here but this discussion is applicable to all collection classes.


&lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/LJKN-roI1mI" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/4731850227618351460/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/07/java-hashmap-working.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/4731850227618351460?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/4731850227618351460?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/LJKN-roI1mI/java-hashmap-working.html" title="Java HashMap Working" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/07/java-hashmap-working.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEAGRn04fyp7ImA9WhVWGEQ.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-3857091019713930175</id><published>2012-04-28T22:31:00.000+05:30</published><updated>2012-05-01T22:48:47.337+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-05-01T22:48:47.337+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Web application" /><category scheme="http://www.blogger.com/atom/ns#" term="Session" /><category scheme="http://www.blogger.com/atom/ns#" term="Java EE" /><category scheme="http://www.blogger.com/atom/ns#" term="Attributes" /><title>How to set Session Attributes in Java,set Session Attribute</title><summary type="html">

Session set Attribute

Attributes are a way to store information in a Java web application for later use. By setting attributes inside a web application, one can keep the information till the point the user is active in the application. Session attributes are created for individual users and destroyed when the user session gets destroyed.

The following code example shows how to get session &lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/6RhBVEGx24I" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/3857091019713930175/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/04/how-to-set-session-attributes-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/3857091019713930175?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/3857091019713930175?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/6RhBVEGx24I/how-to-set-session-attributes-in.html" title="How to set Session Attributes in Java,set Session Attribute" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/04/how-to-set-session-attributes-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEABQ3Y7eCp7ImA9WhVWGEQ.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-7597619504585973217</id><published>2012-04-27T21:43:00.000+05:30</published><updated>2012-05-01T22:49:12.800+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-05-01T22:49:12.800+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Methods" /><category scheme="http://www.blogger.com/atom/ns#" term="Core java" /><category scheme="http://www.blogger.com/atom/ns#" term="Reflection" /><category scheme="http://www.blogger.com/atom/ns#" term="Classes" /><title>Invoke methods of an object using reflection</title><summary type="html">

How to invoke methods of class using reflection

Reflection helps in getting all the information of a class from a Java program. The use of reflection also helps in invoking the methods present in a class by passing the appropriate arguments when invoking the method.

The following program shows how methods of a class can be invoked by using reflection in Java.


package com.example;

import &lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/ojsjRomIV9I" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/7597619504585973217/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/04/invoke-methods-of-object-using.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/7597619504585973217?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/7597619504585973217?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/ojsjRomIV9I/invoke-methods-of-object-using.html" title="Invoke methods of an object using reflection" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/04/invoke-methods-of-object-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEADQHg6fCp7ImA9WhVWGEQ.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-6799308855597645938</id><published>2012-04-26T20:45:00.000+05:30</published><updated>2012-05-01T22:49:31.614+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-05-01T22:49:31.614+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Application" /><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="jar" /><title>How to invoke a Java application from JAR file</title><summary type="html">

Running JAR Files as Applications

If there is a JAR file which you want to run as a Java application then there is an option to do so by using java command line tool.

java -jar jar-file

The -jar flag tells the interpreter that the application is packaged in the JAR file format. For running the above command, one has to make sure that a class with main method exists and the same has been &lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/41UjHQ4kYS4" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/6799308855597645938/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/04/how-to-invoke-java-application-from-jar.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/6799308855597645938?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/6799308855597645938?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/41UjHQ4kYS4/how-to-invoke-java-application-from-jar.html" title="How to invoke a Java application from JAR file" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/04/how-to-invoke-java-application-from-jar.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEANRHs7cCp7ImA9WhVWGEQ.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-4493971010557924190</id><published>2012-04-25T20:33:00.000+05:30</published><updated>2012-05-01T22:49:55.508+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-05-01T22:49:55.508+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Wrapper classes" /><category scheme="http://www.blogger.com/atom/ns#" term="Data Type" /><category scheme="http://www.blogger.com/atom/ns#" term="Core java" /><category scheme="http://www.blogger.com/atom/ns#" term="primitives" /><category scheme="http://www.blogger.com/atom/ns#" term="JDK" /><title>Some important points to note about Wrapper Classes</title><summary type="html">

How to use wrapper classes in Java

Wrapper classes are just normal classes but they have gained significance because of there close association with primitive data types.  Here are some important points to note about wrapper classes in Java.

1) Wrapper classes were introduced in JDK1.5
2) Wrapper classes are Immutable
3) Wrapper classes were introduced so that primitive data types could be &lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/bmPNO4yibd4" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/4493971010557924190/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/04/some-important-points-to-note-about.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/4493971010557924190?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/4493971010557924190?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/bmPNO4yibd4/some-important-points-to-note-about.html" title="Some important points to note about Wrapper Classes" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/04/some-important-points-to-note-about.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE8HQ3Y_fyp7ImA9WhVWGEQ.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-277381330122233646</id><published>2012-04-24T20:26:00.000+05:30</published><updated>2012-05-01T22:50:32.847+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-05-01T22:50:32.847+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="constructor" /><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="String" /><title>String class constructors,Constructors present in String class</title><summary type="html">

String Constructors in Java

Strings are almost unavoidable in any kind of application. The String class in Java provides a number of ways for creating instances of String class. This includes the overloaded constructors, de-serialization and string literals. Here we will see all the overloaded constructors which are present in the String class in Java:


String()
Initializes a newly created &lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/UYkuPsGz7Y8" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/277381330122233646/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/04/string-class-constructorsconstructors.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/277381330122233646?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/277381330122233646?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/UYkuPsGz7Y8/string-class-constructorsconstructors.html" title="String class constructors,Constructors present in String class" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/04/string-class-constructorsconstructors.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE8ASHc-fip7ImA9WhVWGEQ.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-4834600727835599812</id><published>2012-04-23T16:19:00.000+05:30</published><updated>2012-05-01T22:50:49.956+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-05-01T22:50:49.956+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="replaceAll" /><category scheme="http://www.blogger.com/atom/ns#" term="regex" /><category scheme="http://www.blogger.com/atom/ns#" term="String" /><title>Replace a String at multiple places in another string</title><summary type="html">

Replace a String at multiple places in another string

String class in Java provides a number of powerful API method for string manipulation in Java. This includes replacing all occurrences of a string by another in a parent string in Java.



package com.example;


/** This class is a demo for Java Tutorial on how to replace all occurrences of a substring in Java
 *
 * @author Extreme Java
 *
&lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/n5iPPNUQWyM" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/4834600727835599812/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/04/replace-string-at-multiple-places-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/4834600727835599812?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/4834600727835599812?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/n5iPPNUQWyM/replace-string-at-multiple-places-in.html" title="Replace a String at multiple places in another string" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/04/replace-string-at-multiple-places-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D04MQX87eyp7ImA9WhVWEEU.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-3422519301355303189</id><published>2012-04-22T14:43:00.000+05:30</published><updated>2012-04-22T14:43:00.103+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-22T14:43:00.103+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Split" /><category scheme="http://www.blogger.com/atom/ns#" term="parse" /><category scheme="http://www.blogger.com/atom/ns#" term="String" /><title>Parse Comma Delimited List</title><summary type="html">Parse Comma Delimited List

Parsing the contents of string having some delimiter is a common task to be performed in a Java application. There are multiple ways in which strings can be parsed on the basis of delimiter in Java which includes the split method of String class and the StringTokenizer class

The following Java program parses a comma separated list of strings and then splits it based &lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/z8a68GBc3_E" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/3422519301355303189/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/04/parse-comma-delimited-list.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/3422519301355303189?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/3422519301355303189?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/z8a68GBc3_E/parse-comma-delimited-list.html" title="Parse Comma Delimited List" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/04/parse-comma-delimited-list.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A08EQ3k9eCp7ImA9WhVXGUU.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-7022654479246288412</id><published>2012-04-21T12:00:00.000+05:30</published><updated>2012-04-21T12:00:02.760+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-21T12:00:02.760+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Count" /><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="API" /><category scheme="http://www.blogger.com/atom/ns#" term="replace" /><category scheme="http://www.blogger.com/atom/ns#" term="String" /><title>Count number of occurrences of substring in a string</title><summary type="html">Count number of occurrences of substring in a string
There is no direct API method present in the String class which can count the number of occurrence of a substring in another string and return the count. But there are other API methods which can help in counting the number of times one string occurs in other string.

The following code does the job of counting the search string in parent &lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/tA4KHTKst3o" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/7022654479246288412/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/04/count-number-of-occurrences-of.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/7022654479246288412?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/7022654479246288412?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/tA4KHTKst3o/count-number-of-occurrences-of.html" title="Count number of occurrences of substring in a string" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/04/count-number-of-occurrences-of.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkIMQX4-cCp7ImA9WhVXGU0.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-893209128930522724</id><published>2012-04-20T11:13:00.000+05:30</published><updated>2012-04-20T11:13:00.058+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-20T11:13:00.058+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><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="String" /><title>equals() vs == in Java Strings,Compare Strings in Java</title><summary type="html">equals() vs == in Java Strings
equals method is declared in Object class and hence is available to all classes including the String class. But String class overrides the equals method to check for the equality of string content. On the other hand the default behaviour of equals method and == operator is same which is to check if the two references are pointing to the same object or not.

Thus if &lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/3Syfleq2nxI" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/893209128930522724/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/04/equals-vs-in-java-stringscompare.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/893209128930522724?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/893209128930522724?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/3Syfleq2nxI/equals-vs-in-java-stringscompare.html" title="equals() vs == in Java Strings,Compare Strings in Java" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/04/equals-vs-in-java-stringscompare.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0QAQXozeSp7ImA9WhVXGEg.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-8401530497239231172</id><published>2012-04-19T22:39:00.000+05:30</published><updated>2012-04-19T22:39:00.481+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-19T22:39:00.481+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="hashcode" /><category scheme="http://www.blogger.com/atom/ns#" term="String" /><title>String HashCode,hashcode() method in String class Java</title><summary type="html">String HashCode
Hashcode is an important aspect of programs which use hash based collections like HashMap, Hashtable or HashSet. The String class's objects are very frequently used as keys for key,value pairs. 
The following code shows how the hashcode method of String class looks like:

    /**
     * Returns a hash code for this string. The hash code for a
     * String object is computed as
&lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/vRqil77b3Ro" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/8401530497239231172/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/04/string-hashcodehashcode-method-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/8401530497239231172?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/8401530497239231172?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/vRqil77b3Ro/string-hashcodehashcode-method-in.html" title="String HashCode,hashcode() method in String class Java" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/04/string-hashcodehashcode-method-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak8MQX4_eSp7ImA9WhVXF0s.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-2908983671119158789</id><published>2012-04-18T22:38:00.000+05:30</published><updated>2012-04-18T22:38:00.041+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-18T22:38:00.041+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Concatenate Operation" /><category scheme="http://www.blogger.com/atom/ns#" term="String" /><title>String concatenation in System.out.println(),Concatenate Strings</title><summary type="html">String concatenation in System.out.println()
The + operator is overloaded for performing the concatenation operation in Java. When  used in System.out.println() then it automatically invokes the toString method and then uses the + operator to concatenate the strings being used with + operator.


package com.example;

/** This class is a Java tutorial for concatenation of Strings in Java
* 
* @&lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/7fKMMy-tcpk" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/2908983671119158789/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/04/string-concatenation-in.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/2908983671119158789?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/2908983671119158789?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/7fKMMy-tcpk/string-concatenation-in.html" title="String concatenation in System.out.println(),Concatenate Strings" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/04/string-concatenation-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEMGQXw4eSp7ImA9WhVXFkU.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-2306686758077521682</id><published>2012-04-17T22:37:00.000+05:30</published><updated>2012-04-17T22:37:00.231+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-17T22:37:00.231+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="API" /><category scheme="http://www.blogger.com/atom/ns#" term="Trim Space" /><category scheme="http://www.blogger.com/atom/ns#" term="String" /><title>Remove leading and trailing white space from string</title><summary type="html">Remove leading and trailing white space from string
The following program shows how to use regular expressions for trimming leading and trailing spaces in a string object.


package com.example;

/** This class is a Java tutorial for triming left and right spaces in Java
* 
* @author Extreme Java
*/
public class Test{

/** This method shows how to trim white spaces in Java
* 
* @param args
*/
&lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/5rZz06ncNAk" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/2306686758077521682/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/04/remove-leading-and-trailing-white-space.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/2306686758077521682?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/2306686758077521682?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/5rZz06ncNAk/remove-leading-and-trailing-white-space.html" title="Remove leading and trailing white space from string" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/04/remove-leading-and-trailing-white-space.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D04EQXs6cCp7ImA9WhVXFUQ.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-4410142680564399551</id><published>2012-04-16T22:35:00.000+05:30</published><updated>2012-04-16T22:35:00.518+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-16T22:35:00.518+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="API" /><category scheme="http://www.blogger.com/atom/ns#" term="String" /><category scheme="http://www.blogger.com/atom/ns#" term="Compare Contents" /><title>Compairing String and StringBuffer contents,Compare Strings</title><summary type="html">Comparing String and StringBuffer contents
StringBuffer class's objects act like a buffer for adding string contents. As very popularly known that StringBuffer objects are mutable and modifying the contents of string buffer doesn't create new objects. But sometimes, one requires to compare the contents of String object with the contents of StringBuffer object.


package com.example;

/** This &lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/xnPmQncYpSM" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/4410142680564399551/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/04/compairing-string-and-stringbuffer.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/4410142680564399551?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/4410142680564399551?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/xnPmQncYpSM/compairing-string-and-stringbuffer.html" title="Compairing String and StringBuffer contents,Compare Strings" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/04/compairing-string-and-stringbuffer.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0IEQXk8fip7ImA9WhVXFU0.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-3635943785059686988</id><published>2012-04-15T22:35:00.000+05:30</published><updated>2012-04-15T22:35:00.776+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-15T22:35:00.776+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Autoboxing" /><category scheme="http://www.blogger.com/atom/ns#" term="JDK" /><category scheme="http://www.blogger.com/atom/ns#" term="Auto-Unboxing" /><title>Autoboxing and Auto-Unboxing,How to autobox and auto-unbox</title><summary type="html">Autoboxing and Auto-Unboxing
Autoboxing and auto-unboxing is a very useful feature added to JDK which automatically makes sure that primitive to wrapper happens whenever there is a need to do so. The following program shows how auto-boxing and auto-unboxing works in Java programs:

package com.example;

/** This class is a Java tutorial for auto-boxing and auto-unboxing in Java
 * 
 * @author &lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/PccvSJteBR8" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/3635943785059686988/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/04/autoboxing-and-auto-unboxinghow-to.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/3635943785059686988?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/3635943785059686988?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/PccvSJteBR8/autoboxing-and-auto-unboxinghow-to.html" title="Autoboxing and Auto-Unboxing,How to autobox and auto-unbox" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/04/autoboxing-and-auto-unboxinghow-to.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4MQXc_eyp7ImA9WhVXFE8.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-2007627775369593445</id><published>2012-04-14T22:33:00.000+05:30</published><updated>2012-04-14T22:33:00.943+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-14T22:33:00.943+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Unit Testing" /><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse" /><category scheme="http://www.blogger.com/atom/ns#" term="JUnit" /><title>Alternatives to JUnit for unit testing</title><summary type="html">Alternatives to JUnit for unit testing
JUnit is very popular unit testing framework for Java projects. The best part of it is that Eclipse IDE comes with built in suport for latest version of JUnit. But still there are some features which are not right now available in JUnit and alternatives have been developed for the same. The following list shows some of the best alternatives for JUnit which &lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/IYIdmNgxqDQ" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/2007627775369593445/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/04/alternatives-to-junit-for-unit-testing.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/2007627775369593445?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/2007627775369593445?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/IYIdmNgxqDQ/alternatives-to-junit-for-unit-testing.html" title="Alternatives to JUnit for unit testing" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/04/alternatives-to-junit-for-unit-testing.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEIGQXo4eCp7ImA9WhVXE04.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-4069935547668153111</id><published>2012-04-13T22:32:00.000+05:30</published><updated>2012-04-13T22:32:00.430+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-13T22:32:00.430+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Type Conversion" /><category scheme="http://www.blogger.com/atom/ns#" term="Data Type" /><category scheme="http://www.blogger.com/atom/ns#" term="Core java" /><title>Widening and Narrowing conversion in Java,Type Conversion in Java</title><summary type="html">Widening and Narrowing conversion in Java
In Java data types can be converted from one form to another. But since each data type has a range of values which can be assigned and the use of type casting and assignment from wider and narrow data types can happen. For example int and long are compatible data types where int value can be assigned to long variable and long value to an int variable.

&lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/xIV3XJhs9zc" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/4069935547668153111/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/04/widening-and-narrowing-conversion-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/4069935547668153111?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/4069935547668153111?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/xIV3XJhs9zc/widening-and-narrowing-conversion-in.html" title="Widening and Narrowing conversion in Java,Type Conversion in Java" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/04/widening-and-narrowing-conversion-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEECQXk7cCp7ImA9WhVXEk8.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-3222108390475191547</id><published>2012-04-12T16:01:00.000+05:30</published><updated>2012-04-12T16:01:00.708+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-12T16:01:00.708+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Lower Case" /><category scheme="http://www.blogger.com/atom/ns#" term="Upper Case" /><category scheme="http://www.blogger.com/atom/ns#" term="Core java" /><category scheme="http://www.blogger.com/atom/ns#" term="String Case" /><title>Toggle String case in Java,Lower Upper Case in Java Program</title><summary type="html">Toggle String case in Java
The String class API allows for changing the case of a String to upper or lower case. However there is no method for detecting the case and then change the case accordingly. One can use the Character class to detect the case and then toggle the case of each of the character present in the String.

package com.example;

/** This class is a Java tutorial for toggling &lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/EWe3OZPvmTM" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/3222108390475191547/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/04/toggle-string-case-in-javalower-upper.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/3222108390475191547?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/3222108390475191547?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/EWe3OZPvmTM/toggle-string-case-in-javalower-upper.html" title="Toggle String case in Java,Lower Upper Case in Java Program" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/04/toggle-string-case-in-javalower-upper.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkYAQX4-cSp7ImA9WhVXEUk.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-652242228957290889</id><published>2012-04-11T15:59:00.000+05:30</published><updated>2012-04-11T15:59:00.059+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-11T15:59:00.059+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="substring" /><category scheme="http://www.blogger.com/atom/ns#" term="Core java" /><category scheme="http://www.blogger.com/atom/ns#" term="lastIndexOf" /><category scheme="http://www.blogger.com/atom/ns#" term="String" /><title>Using lastIndexOf in Strings Java,get Character from String</title><summary type="html">How to use lastIndexOf in String class
The String API has methods for searching a particular character starting from reverse of the String. The method lastIndexOf is used to find the last occurrence of a character in a String. Once you get the index of last occurrence, simply get the character using charAt method which accepts integer index as argument.

package com.example;

/** This class is a &lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/ix8vtKxF2P0" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/652242228957290889/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/04/using-lastindexof-in-strings-javaget.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/652242228957290889?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/652242228957290889?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/ix8vtKxF2P0/using-lastindexof-in-strings-javaget.html" title="Using lastIndexOf in Strings Java,get Character from String" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/04/using-lastindexof-in-strings-javaget.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEGQXkzeCp7ImA9WhVXEEg.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-6131203495634801566</id><published>2012-04-10T15:57:00.000+05:30</published><updated>2012-04-10T15:57:00.780+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-10T15:57:00.780+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Character" /><category scheme="http://www.blogger.com/atom/ns#" term="array" /><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="String" /><title>Convert String to character array to String</title><summary type="html">Convert String to character array to String
The String class internally uses the character array for storing the characters present in the string. This  means that we can convert a String object into character array and also convert a character array to String object.

The code to convert a character array to String is shown below:

public class MyTest{
 public static void main(String[] args) {
&lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/ddY3AuILwHo" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/6131203495634801566/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/04/convert-string-to-character-array-to.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/6131203495634801566?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/6131203495634801566?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/ddY3AuILwHo/convert-string-to-character-array-to.html" title="Convert String to character array to String" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/04/convert-string-to-character-array-to.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUYEQX0yfSp7ImA9WhVQGUs.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-7430400687991239839</id><published>2012-04-09T15:55:00.000+05:30</published><updated>2012-04-09T15:55:00.395+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-09T15:55:00.395+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MetaData" /><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Annotation" /><title>How to create custom annotation in Java</title><summary type="html">How to create custom annotation in Java
Annotations were introduced in JDK 1.5 and act like meta data. In this tutorial, we will see how to create a new annotation and then use it  in other classes. The following code shows how to create annotation in Java.


public @interface MyAnnotation {


    public String str1();


    public String str2();




}


In order to apply the above annotation to &lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/lYdqWsD6LUU" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/7430400687991239839/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/04/how-to-create-custom-annotation-in-java.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/7430400687991239839?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/7430400687991239839?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/lYdqWsD6LUU/how-to-create-custom-annotation-in-java.html" title="How to create custom annotation in Java" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/04/how-to-create-custom-annotation-in-java.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0YGQXY6cSp7ImA9WhVQGEQ.&quot;"><id>tag:blogger.com,1999:blog-2723424032685314284.post-4141915317576676139</id><published>2012-04-08T21:02:00.000+05:30</published><updated>2012-04-08T21:02:00.819+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-08T21:02:00.819+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Capital Characters" /><category scheme="http://www.blogger.com/atom/ns#" term="String" /><title>How to capitalize the first character of string</title><summary type="html">How to capitalize the first character of string
If you are searching for the logic to automatically capatializing the first character of a string then the code shown below should be used to do so.

package com.example;

/** This class is a Java tutorial for making the first character as capital in Java
 * 
 * @author Extreme Java
 */
public class Test{
    
    /** This method shows how to &lt;img src="http://feeds.feedburner.com/~r/ExtremeJava/~4/s151g-KlJo0" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://extreme-java.blogspot.com/feeds/4141915317576676139/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://extreme-java.blogspot.com/2012/04/how-to-capitalize-first-character-of.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/4141915317576676139?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2723424032685314284/posts/default/4141915317576676139?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtremeJava/~3/s151g-KlJo0/how-to-capitalize-first-character-of.html" title="How to capitalize the first character of string" /><author><name>Sandeep Bhandari</name><uri>https://plus.google.com/108156674671499593770</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-6fkrhVX9NrM/AAAAAAAAAAI/AAAAAAAAAb4/s8q4a3zDXnY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://extreme-java.blogspot.com/2012/04/how-to-capitalize-first-character-of.html</feedburner:origLink></entry></feed>
