<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:series="http://organizeseries.com/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Rithus Tutorials</title>
	
	<link>http://rithus.com</link>
	<description>Programming == Fun</description>
	<lastBuildDate>Tue, 08 Jan 2013 13:32:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/RithusTutorials" /><feedburner:info uri="rithustutorials" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>RithusTutorials</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>JSPs and Servlets Video Tutorial</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/WMITRnCxNV8/jsps-and-servlets-video-tutorial</link>
		<comments>http://rithus.com/jsps-and-servlets-video-tutorial#comments</comments>
		<pubDate>Sun, 23 Dec 2012 08:15:18 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/?p=1995</guid>
		<description><![CDATA[Table Of Contents 1. JSPs and Servlets &#8211; Video 1 2. JSPs and Servlets &#8211; Video 2 3. JSPs and Servlets &#8211; Video 3 4. JSPs and Servlets &#8211; Video 4 5. JSPs and Servlets &#8211; Video 5 6. Subscribe for more videos Welcome to Rithus.com. You one stop destination for all C,C++, .Net and [...]]]></description>
				<content:encoded><![CDATA[<article>
<div class="toc">
<div class="header">Table Of Contents</div>
<dl>
<dt><a href="#1.">1. JSPs and Servlets &#8211; Video 1</a></dt>
<dt><a href="#2.">2. JSPs and Servlets &#8211; Video 2</a></dt>
<dt><a href="#3.">3. JSPs and Servlets &#8211; Video 3</a></dt>
<dt><a href="#4.">4. JSPs and Servlets &#8211; Video 4</a></dt>
<dt><a href="#5.">5. JSPs and Servlets &#8211; Video 5</a></dt>
<dt><a href="#6.">6. Subscribe for more videos</a></dt>
</dl></div>
<p>   Welcome to Rithus.com. You one stop destination for all C,C++, .Net and Java videos and tutorials. We thank Koushik for this tutorial series. http://www.youtube.com/user/koushks.</p>
<section><a name="1." /><H2>1. JSPs and Servlets &#8211; Video 1</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/b42CJ0r-1to?rel=0" frameborder="0" allowfullscreen></iframe><iframe width="640" height="480" src="http://www.youtube.com/embed/oX2rw5pAdxw?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="2." /><H2>2. JSPs and Servlets &#8211; Video 2</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/gU0RebsaFzQ?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="3." /><H2>3. JSPs and Servlets &#8211; Video 3</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/YxuCG0f14hM?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="4." /><H2>4. JSPs and Servlets &#8211; Video 4</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/w6YPK9xunCk?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="5." /><H2>5. JSPs and Servlets &#8211; Video 5</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/MnUJl3NYRRc?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="6." /><H2>6. Subscribe to get email updates</H2><P>We will provide more links and videos regarding JSPs and Servlets soon. Please visit the source or please <A href="http://feedburner.google.com/fb/a/mailverify?uri=RithusTutorials&#038;loc=en_US">SUBSCRIBE</A> to get an email when we post more videos. </P></section>
</article>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/WMITRnCxNV8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/jsps-and-servlets-video-tutorial/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://rithus.com/jsps-and-servlets-video-tutorial</feedburner:origLink></item>
		<item>
		<title>Java : Nested Classes – Inner Class and Static Nested Class Example Program Code</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/qZu8YOLbkB0/java-nested-classes-inner-class-and-static-nested-class</link>
		<comments>http://rithus.com/java-nested-classes-inner-class-and-static-nested-class#comments</comments>
		<pubDate>Thu, 20 Dec 2012 15:02:26 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/java-nested-classes-inner-class-and-static-nested-class</guid>
		<description><![CDATA[This entry is part 104 of 104 in the series Java example programs and codeThere are two types of nested classes in Java : Inner class and Static Nested Class. Lets look at them in detail with examples. Consider the class below: public class NestedClass { private int outerClassVariable; public static class StaticNestedClass { private [...]]]></description>
				<content:encoded><![CDATA[<div class="seriesmeta">This entry is part 104 of 104 in the series <a href="http://rithus.com/tutorials/java-example-programs-source-code" class="series-10" title="Java example programs and code">Java example programs and code</a></div><p>There are two types of nested classes in Java : Inner class and Static Nested Class. Lets look at them in detail with examples.</p>
<ol>
<li> Consider the class below:
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
public class NestedClass {
	private int outerClassVariable;

	public static class StaticNestedClass {
		private int staticNestedClassVariable;

		public int getStaticNestedClassVariable() {
			return staticNestedClassVariable;
		}

		public void setStaticNestedClassVariable
				(int staticNestedClassVariable) {
			this.staticNestedClassVariable 
					= staticNestedClassVariable;
		}

		public void privateVariablesOfOuterClassAreNOTAvailable() {
			// outerClassVariable = 5; //COMPILE ERROR
		}
	}

	public class InnerClass {
		private int innerClassVariable;

		public int getInnerClassVariable() {
			return innerClassVariable;
		}

		public void setInnerClassVariable(int innerClassVariable) {
			this.innerClassVariable = innerClassVariable;
		}

		public void privateVariablesOfOuterClassAreAvailable() {
			outerClassVariable = 5; // we can access the value
		}
	}

</pre>
</li>
<li>The above example clearly shows what can/cannot be done in each type of Nested Class.</li>
<li>Consider the JUnit Test below. This show what can/cannot be done with a Static Nested Class.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	@Test
	public void staticClass() {
		// Static Nested Class can be created 
		// without needing to create its parent. 
		// Without creating NestedClassesExample, 
		// we created StaticNestedClass
		NestedClass.StaticNestedClass staticNestedClass1 = 
				new NestedClass.StaticNestedClass();
		
		staticNestedClass1.setStaticNestedClassVariable(5);

		NestedClass.StaticNestedClass staticNestedClass2 = 
				new NestedClass.StaticNestedClass();
		staticNestedClass2.setStaticNestedClassVariable(10);

		// Static Nested Class member variables are not static. 
		// They can have different values.
		assertEquals(5, staticNestedClass1.
						getStaticNestedClassVariable());
		assertEquals(10, staticNestedClass2.
						getStaticNestedClassVariable());
	}

</pre>
</li>
<li>Below Junit shows the features of an Inner Class.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	@Test
	public void innerClass() {
		// COMPILER ERROR! 
		//You cannot create an inner class on its own.
		// InnerClass innerClass = new InnerClass();
		NestedClass example = new NestedClass();

		// To create an Inner Class 
		// you need an instance of Outer Class
		NestedClass.InnerClass innerClass = 
				example.new InnerClass();

		assertEquals(0, 
			innerClass.getInnerClassVariable());
	}
</pre>
</li>
</ol>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/qZu8YOLbkB0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/java-nested-classes-inner-class-and-static-nested-class/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[Java example programs and code]]></series:name>
	<feedburner:origLink>http://rithus.com/java-nested-classes-inner-class-and-static-nested-class</feedburner:origLink></item>
		<item>
		<title>Java : Method hiding Example Program Code</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/WSkp2Ja8UA0/java-method-hiding</link>
		<comments>http://rithus.com/java-method-hiding#comments</comments>
		<pubDate>Thu, 20 Dec 2012 15:02:26 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/java-method-hiding</guid>
		<description><![CDATA[This entry is part 102 of 104 in the series Java example programs and codeLets look at a Java example of method hiding. SuperClass declares a method named methodToHide. class SuperClass{ public int methodToHide(){ return -1; } } Lets create a sub class extending previous class with a method with same signature but returning different [...]]]></description>
				<content:encoded><![CDATA[<div class="seriesmeta">This entry is part 102 of 104 in the series <a href="http://rithus.com/tutorials/java-example-programs-source-code" class="series-10" title="Java example programs and code">Java example programs and code</a></div><p>Lets look at a Java example of method hiding.</p>
<ol>
<li>SuperClass declares a method named methodToHide.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [2];">
	class SuperClass{
		public int methodToHide(){
			return -1;
		}
	}
</pre>
</li>
<li>Lets create a sub class extending previous class with a method with same signature but returning different value.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [2];">
	class SubClass extends SuperClass{
		public int methodToHide(){
			return 1;
		}
	}
</pre>
</li>
<li> Lets write a Junit. We crete a SubClass instance and call methodToHide. The value returned is from the sub class method. So, the sub class method is effectively hiding the super class method. This is &#8220;Method Hiding&#8221;.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	@Test
	public void methodHidingBasicExample(){
		SubClass subClass = new SubClass();
		
		//Method from super class is hidden 
		//by the method in sub class
		assertEquals(1, subClass.methodToHide());		
	}

</pre>
</li>
</ol>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/WSkp2Ja8UA0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/java-method-hiding/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[Java example programs and code]]></series:name>
	<feedburner:origLink>http://rithus.com/java-method-hiding</feedburner:origLink></item>
		<item>
		<title>Java : Copy Constructor Example Program Code</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/IL1uRex3F5E/java-copy-constructor</link>
		<comments>http://rithus.com/java-copy-constructor#comments</comments>
		<pubDate>Thu, 20 Dec 2012 15:02:26 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/java-copy-constructor</guid>
		<description><![CDATA[This entry is part 100 of 104 in the series Java example programs and codeA copy constructor accepts an instance of the same class as parameter and sets appropriate values. Lets look at an example. Consider the Student class below. The second constructor &#8220;Student(Student student)&#8221; is a copy constructor. class Student { // should ideally [...]]]></description>
				<content:encoded><![CDATA[<div class="seriesmeta">This entry is part 100 of 104 in the series <a href="http://rithus.com/tutorials/java-example-programs-source-code" class="series-10" title="Java example programs and code">Java example programs and code</a></div><p>A copy constructor accepts an instance of the same class as parameter and sets appropriate values. Lets look at an example.</p>
<ol>
<li> Consider the Student class below. The second constructor &#8220;Student(Student student)&#8221; is a copy constructor.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	class Student {
		// should ideally be private
		String name;
		// should ideally be private
		int marks;

		// Typical Constructor
		Student(String name, int marks) {
			this.name = name;
			this.marks = marks;
		}

		// Copy Constructor - constructor 
		// which receives the same type
		// as current class as argument
		Student(Student student) {
			name = student.name;
			marks = student.marks;
		}
	}
</pre>
</li>
<li>Lets write a Junit to test the copy constructor.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	@Test
	public void copyConstructorTest() {
		Student student = 
					new Student(&quot;Ramya&quot;, 100);

		// uses copy constructor
		Student studentCopy = 
					new Student(student); 

		assertEquals(&quot;Ramya&quot;, studentCopy.name);
		assertEquals(100, studentCopy.marks);
	}
</pre>
</li>
</ol>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/IL1uRex3F5E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/java-copy-constructor/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[Java example programs and code]]></series:name>
	<feedburner:origLink>http://rithus.com/java-copy-constructor</feedburner:origLink></item>
		<item>
		<title>Java : Constructor Chaining Example Program Code</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/M-nYM94nk7Q/java-constructor-chaining</link>
		<comments>http://rithus.com/java-constructor-chaining#comments</comments>
		<pubDate>Thu, 20 Dec 2012 15:02:26 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/java-constructor-chaining</guid>
		<description><![CDATA[This entry is part 98 of 104 in the series Java example programs and codeConstructor chaining is a concept in oops where a constructor invokes a super class constructor and so on. Lets look at an example. Lets create a class called SuperClass. class SuperClass{ //ideally should be private String name; public SuperClass(String name){ this.name [...]]]></description>
				<content:encoded><![CDATA[<div class="seriesmeta">This entry is part 98 of 104 in the series <a href="http://rithus.com/tutorials/java-example-programs-source-code" class="series-10" title="Java example programs and code">Java example programs and code</a></div><p>Constructor chaining is a concept in oops where a constructor invokes a super class constructor and so on. Lets look at an example.		    </p>
<ol>
<li>Lets create a class called SuperClass.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	class SuperClass{
		//ideally should be private
		String name;
		public SuperClass(String name){
			this.name = name;
		}
	}

</pre>
</li>
<li>Consider a sub class of previously created class. The constructor calls super(name). This is called constructor chaining.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	class SubClass extends SuperClass{
		//ideally should be private
		int value;
		public SubClass(String name,int value){
			super(name);//Constructot Chaining.
			this.value = value;
		}
	}

</pre>
</li>
<li>Lets write a small test to verify behavior.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	@Test
	public void constuctorChaining(){
		SubClass subClass = new SubClass(&quot;SAMPLE&quot;,10);
		assertEquals(&quot;SAMPLE&quot;,subClass.name);
		assertEquals(10,subClass.value);
	}
</pre>
</li>
</ol>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/M-nYM94nk7Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/java-constructor-chaining/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[Java example programs and code]]></series:name>
	<feedburner:origLink>http://rithus.com/java-constructor-chaining</feedburner:origLink></item>
		<item>
		<title>Maven Video Tutorial</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/NcDx-wMETck/maven-video-tutorial</link>
		<comments>http://rithus.com/maven-video-tutorial#comments</comments>
		<pubDate>Thu, 20 Dec 2012 08:10:23 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/?p=1993</guid>
		<description><![CDATA[Table Of Contents 1. Maven Tutorial &#8211; Video 1 2. Maven Tutorial &#8211; Video 2 3. Maven Tutorial &#8211; Video 3 4. Maven Tutorial &#8211; Video 4 5. Maven Tutorial &#8211; Video 5 6. Subscribe for more videos Welcome to Rithus.com. You one stop destination for all C,C++, .Net and Java videos and tutorials. We [...]]]></description>
				<content:encoded><![CDATA[<article>
<div class="toc">
<div class="header">Table Of Contents</div>
<dl>
<dt><a href="#1.">1. Maven Tutorial &#8211; Video 1</a></dt>
<dt><a href="#2.">2. Maven Tutorial &#8211; Video 2</a></dt>
<dt><a href="#3.">3. Maven Tutorial &#8211; Video 3</a></dt>
<dt><a href="#4.">4. Maven Tutorial &#8211; Video 4</a></dt>
<dt><a href="#5.">5. Maven Tutorial &#8211; Video 5</a></dt>
<dt><a href="#6.">6. Subscribe for more videos</a></dt>
</dl></div>
<p>   Welcome to Rithus.com. You one stop destination for all C,C++, .Net and Java videos and tutorials. We thank Koushik for this tutorial series. http://www.youtube.com/user/koushks.</p>
<section><a name="1." /><H2>1. Maven Tutorial &#8211; Video 1</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/al7bRZzz4oU?rel=0" frameborder="0" allowfullscreen></iframe><iframe width="640" height="480" src="http://www.youtube.com/embed/KlIM897RGwc?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="2." /><H2>2. Maven Tutorial &#8211; Video 2</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/AI8Kjag1vGk?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="3." /><H2>3. Maven Tutorial &#8211; Video 3</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/IYRYbPR5Gek?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="4." /><H2>4. Maven Tutorial &#8211; Video 4</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/IRKu8_l5YiQ?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="5." /><H2>5. Maven Tutorial &#8211; Video 5</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/mpNnbBmh5J4?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="6." /><H2>6. Subscribe to get email updates</H2><P>We will provide more links and videos regarding Maven Tutorial soon. Please visit the source or please <A href="http://feedburner.google.com/fb/a/mailverify?uri=RithusTutorials&#038;loc=en_US">SUBSCRIBE</A> to get an email when we post more videos. </P></section>
</article>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/NcDx-wMETck" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/maven-video-tutorial/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://rithus.com/maven-video-tutorial</feedburner:origLink></item>
		<item>
		<title>Hibernate Video Tutorial</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/7sjGPu7d5F0/hibernate-video-tutorial</link>
		<comments>http://rithus.com/hibernate-video-tutorial#comments</comments>
		<pubDate>Tue, 18 Dec 2012 08:06:11 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/?p=1990</guid>
		<description><![CDATA[Table Of Contents 1. Hibernate Tutorial &#8211; Video 1 2. Hibernate Tutorial &#8211; Video 2 3. Hibernate Tutorial &#8211; Video 3 4. Hibernate Tutorial &#8211; Video 4 5. Hibernate Tutorial &#8211; Video 5 6. Subscribe for more videos Welcome to Rithus.com. You one stop destination for all C,C++, .Net and Java videos and tutorials. We [...]]]></description>
				<content:encoded><![CDATA[<article>
<div class="toc">
<div class="header">Table Of Contents</div>
<dl>
<dt><a href="#1.">1. Hibernate Tutorial &#8211; Video 1</a></dt>
<dt><a href="#2.">2. Hibernate Tutorial &#8211; Video 2</a></dt>
<dt><a href="#3.">3. Hibernate Tutorial &#8211; Video 3</a></dt>
<dt><a href="#4.">4. Hibernate Tutorial &#8211; Video 4</a></dt>
<dt><a href="#5.">5. Hibernate Tutorial &#8211; Video 5</a></dt>
<dt><a href="#6.">6. Subscribe for more videos</a></dt>
</dl></div>
<p>      Welcome to Rithus.com. You one stop destination for all C,C++, .Net and Java videos and tutorials. We thank Koushik for this tutorial series. http://www.youtube.com/user/koushks.</p>
<section><a name="1." /><H2>1. Hibernate Tutorial &#8211; Video 1</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/Yv2xctJxE-w?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="2." /><H2>2. Hibernate Tutorial &#8211; Video 2</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/bzPkebUXxn0?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="3." /><H2>3. Hibernate Tutorial &#8211; Video 3</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/N2F1zCAf_NU?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="4." /><H2>4. Hibernate Tutorial &#8211; Video 4</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/3eXjpve0QaI?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="5." /><H2>5. Hibernate Tutorial &#8211; Video 5</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/FFMOZY4z6bE?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="6." /><H2>6. Subscribe to get email updates</H2><P>We will provide more links and videos regarding Hibernate Tutorial soon. Please visit the source or please <A href="http://feedburner.google.com/fb/a/mailverify?uri=RithusTutorials&#038;loc=en_US">SUBSCRIBE</A> to get an email when we post more videos. </P></section>
</article>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/7sjGPu7d5F0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/hibernate-video-tutorial/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://rithus.com/hibernate-video-tutorial</feedburner:origLink></item>
		<item>
		<title>Spring Framework Video Tutorial</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/_1qAaHL3kG8/spring-framework-video-tutorial</link>
		<comments>http://rithus.com/spring-framework-video-tutorial#comments</comments>
		<pubDate>Mon, 17 Dec 2012 08:01:14 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/?p=1987</guid>
		<description><![CDATA[Table Of Contents 1. Spring Tutorial &#8211; Video 1 2. Spring Tutorial &#8211; Video 2 3. Spring Tutorial &#8211; Video 3 4. Spring Tutorial &#8211; Video 4 5. Spring Tutorial &#8211; Video 5 6. Subscribe for more videos Welcome to Rithus.com. You one stop destination for all C,C++, .Net and Java videos and tutorials. We [...]]]></description>
				<content:encoded><![CDATA[<article>
<div class="toc">
<div class="header">Table Of Contents</div>
<dl>
<dt><a href="#1.">1. Spring Tutorial &#8211; Video 1</a></dt>
<dt><a href="#2.">2. Spring Tutorial &#8211; Video 2</a></dt>
<dt><a href="#3.">3. Spring Tutorial &#8211; Video 3</a></dt>
<dt><a href="#4.">4. Spring Tutorial &#8211; Video 4</a></dt>
<dt><a href="#5.">5. Spring Tutorial &#8211; Video 5</a></dt>
<dt><a href="#6.">6. Subscribe for more videos</a></dt>
</dl></div>
<p>   Welcome to Rithus.com. You one stop destination for all C,C++, .Net and Java videos and tutorials. We thank Koushik for this tutorial series. http://www.youtube.com/user/koushks.</p>
<section><a name="1." /><H2>1. Spring Tutorial &#8211; Video 1</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/GB8k2-Egfv0?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="2." /><H2>2. Spring Tutorial &#8211; Video 2</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/Z5gubdHLJIc?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="3." /><H2>3. Spring Tutorial &#8211; Video 3</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/xlWwMSu5I70?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="4." /><H2>4. Spring Tutorial &#8211; Video 4</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/7c6ZTF6cF88?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="5." /><H2>5. Spring Tutorial &#8211; Video 5</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/ZxLaEovze3M?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="6." /><H2>6. Subscribe to get email updates</H2><P>We will provide more links and videos regarding Spring Tutorial soon. Please visit the source or please <A href="http://feedburner.google.com/fb/a/mailverify?uri=RithusTutorials&#038;loc=en_US">SUBSCRIBE</A> to get an email when we post more videos. </P></section>
</article>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/_1qAaHL3kG8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/spring-framework-video-tutorial/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://rithus.com/spring-framework-video-tutorial</feedburner:origLink></item>
		<item>
		<title>.Net Video Tutorial</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/IwwprHjsWPs/net-video-tutorial</link>
		<comments>http://rithus.com/net-video-tutorial#comments</comments>
		<pubDate>Sun, 16 Dec 2012 08:19:22 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/?p=1998</guid>
		<description><![CDATA[Table Of Contents 1. .Net Tutorial &#8211; Video 1 2. .Net Tutorial &#8211; Video 2 3. .Net Tutorial &#8211; Video 3 4. .Net Tutorial &#8211; Video 4 5. .Net Tutorial &#8211; Video 5 6. Subscribe for more videos Welcome to Rithus.com. You one stop destination for all C,C++, .Net and Java videos and tutorials. 1. [...]]]></description>
				<content:encoded><![CDATA[<article>
<div class="toc">
<div class="header">Table Of Contents</div>
<dl>
<dt><a href="#1.">1. .Net Tutorial &#8211; Video 1</a></dt>
<dt><a href="#2.">2. .Net Tutorial &#8211; Video 2</a></dt>
<dt><a href="#3.">3. .Net Tutorial &#8211; Video 3</a></dt>
<dt><a href="#4.">4. .Net Tutorial &#8211; Video 4</a></dt>
<dt><a href="#5.">5. .Net Tutorial &#8211; Video 5</a></dt>
<dt><a href="#6.">6. Subscribe for more videos</a></dt>
</dl></div>
<p>   Welcome to Rithus.com. You one stop destination for all C,C++, .Net and Java videos and tutorials. </p>
<section><a name="1." /><H2>1. .Net Tutorial &#8211; Video 1</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/E1UAorR4Vps?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="2." /><H2>2. .Net Tutorial &#8211; Video 2</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/imnNoW6xIPk?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="3." /><H2>3. .Net Tutorial &#8211; Video 3</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/smvPfhR1f_0?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="4." /><H2>4. .Net Tutorial &#8211; Video 4</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/76hvNzQ6swo?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="5." /><H2>5. .Net Tutorial &#8211; Video 5</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/5q_7euip4po?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="6." /><H2>6. Subscribe to get email updates</H2><P>We will provide more links and videos regarding .Net Tutorial soon. Please visit the source or please <A href="http://feedburner.google.com/fb/a/mailverify?uri=RithusTutorials&#038;loc=en_US">SUBSCRIBE</A> to get an email when we post more videos. </P></section>
</article>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/IwwprHjsWPs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/net-video-tutorial/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://rithus.com/net-video-tutorial</feedburner:origLink></item>
		<item>
		<title>Struts 2 Video Tutorial</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/WF_DudsOfWs/struts-2-video-tutorial</link>
		<comments>http://rithus.com/struts-2-video-tutorial#comments</comments>
		<pubDate>Sun, 16 Dec 2012 07:58:19 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/?p=1982</guid>
		<description><![CDATA[Table Of Contents 1. Struts 2 Tutorial &#8211; Video 1 2. Struts 2 Tutorial &#8211; Video 2 3. Struts 2 Tutorial &#8211; Video 3 4. Struts 2 Tutorial &#8211; Video 4 5. Struts 2 Tutorial &#8211; Video 5 6. Subscribe for more videos Welcome to Rithus.com. You one stop destination for all C,C++, .Net and [...]]]></description>
				<content:encoded><![CDATA[<article>
<div class="toc">
<div class="header">Table Of Contents</div>
<dl>
<dt><a href="#1.">1. Struts 2 Tutorial &#8211; Video 1</a></dt>
<dt><a href="#2.">2. Struts 2 Tutorial &#8211; Video 2</a></dt>
<dt><a href="#3.">3. Struts 2 Tutorial &#8211; Video 3</a></dt>
<dt><a href="#4.">4. Struts 2 Tutorial &#8211; Video 4</a></dt>
<dt><a href="#5.">5. Struts 2 Tutorial &#8211; Video 5</a></dt>
<dt><a href="#6.">6. Subscribe for more videos</a></dt>
</dl></div>
<p>   Welcome to Rithus.com. You one stop destination for all C,C++, .Net and Java videos and tutorials. We thank Koushik for this tutorial series. http://www.youtube.com/user/koushks.</p>
<section><a name="1." /><H2>1. Struts 2 Tutorial &#8211; Video 1</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/f46WEeM8HTA?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="2." /><H2>2. Struts 2 Tutorial &#8211; Video 2</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/9BvQpf7JcOI?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="3." /><H2>3. Struts 2 Tutorial &#8211; Video 3</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/LhjEgxJ080g?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="4." /><H2>4. Struts 2 Tutorial &#8211; Video 4</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/u4Pn1rdv5Is?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="5." /><H2>5. Struts 2 Tutorial &#8211; Video 5</H2><P><iframe width="640" height="480" src="http://www.youtube.com/embed/1rDnWURZOWI?rel=0" frameborder="0" allowfullscreen></iframe></P></section>
<section><a name="6." /><H2>6. Subscribe to get email updates</H2><P>We will provide more links and videos regarding Struts 2 Tutorial soon. Please visit the source or please <A href="http://feedburner.google.com/fb/a/mailverify?uri=RithusTutorials&#038;loc=en_US">SUBSCRIBE</A> to get an email when we post more videos. </P></section>
</article>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/WF_DudsOfWs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/struts-2-video-tutorial/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://rithus.com/struts-2-video-tutorial</feedburner:origLink></item>
		<item>
		<title>Java : Constructor Basics Example Program Code</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/incVSoUm4Rw/java-constructor-basics</link>
		<comments>http://rithus.com/java-constructor-basics#comments</comments>
		<pubDate>Sat, 15 Dec 2012 15:02:26 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/java-constructor-basics</guid>
		<description><![CDATA[This entry is part 97 of 104 in the series Java example programs and code Consider the example Student class below: class Student { String name; } Below test uses default constuctor provided by Java.Name is assigned null value since we did not initialize name. @Test public void defaultConstructor() { Student student = new Student(); [...]]]></description>
				<content:encoded><![CDATA[<div class="seriesmeta">This entry is part 97 of 104 in the series <a href="http://rithus.com/tutorials/java-example-programs-source-code" class="series-10" title="Java example programs and code">Java example programs and code</a></div><ol>
<li>Consider the example Student class below:
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	class Student {
		String name;
	}
</pre>
</li>
<li>Below test uses default constuctor provided by Java.Name is assigned null value since we did not initialize name.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	@Test
	public void defaultConstructor() {
		Student student = new Student();
		assertNull(student.name);
	}
</pre>
</li>
<li> Lets add an one argument constructor to a new student class.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	class StudentWithOneArgumentConstructor {
		String name;// Should ideally be private;

		public StudentWithOneArgumentConstructor
								(String name) {
			this.name = name;
		}
	}
</pre>
</li>
<li> The default constructor does not work anymore.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">

/* COMPILE ERROR! Default Constructor 
 * no longer works!
 * As soon as we create one constructor, 
 * Java expects us to provide all others
 * 
 *	StudentWithOneArgumentConstructor student = 
 * 				new StudentWithOneArgumentConstructor();
 */ 
</pre>
</li>
<li>However, we can create objects using the one argument constructor.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
		StudentWithOneArgumentConstructor student =
				new StudentWithOneArgumentConstructor(&quot;Tom&quot;);
		 assertEquals(&quot;Tom&quot;,student.name); 
</pre>
</li>
</ol>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/incVSoUm4Rw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/java-constructor-basics/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[Java example programs and code]]></series:name>
	<feedburner:origLink>http://rithus.com/java-constructor-basics</feedburner:origLink></item>
		<item>
		<title>Java : Sorted Collection Example Program Code</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/U_tqleDELxQ/java-sorted-collection</link>
		<comments>http://rithus.com/java-sorted-collection#comments</comments>
		<pubDate>Sat, 15 Dec 2012 15:02:26 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/java-sorted-collection</guid>
		<description><![CDATA[This entry is part 96 of 104 in the series Java example programs and codeLets look at a collection, which ensures that the elements are always sorted. In a SortedSet Collection, elements are always sorted. Look at the example below. @Test public void sortedCollection(){ /*KNOWN ISSUE : Cannot contain Duplicates*/ Set&#60;String&#62; sortedSet = new TreeSet&#60;String&#62;(); [...]]]></description>
				<content:encoded><![CDATA[<div class="seriesmeta">This entry is part 96 of 104 in the series <a href="http://rithus.com/tutorials/java-example-programs-source-code" class="series-10" title="Java example programs and code">Java example programs and code</a></div><p>Lets look at a collection, which ensures that the elements are always sorted.</p>
<ol>
<li> In a SortedSet Collection, elements are always sorted. Look at the example below.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	@Test
	public void sortedCollection(){
		/*KNOWN ISSUE : Cannot contain Duplicates*/
		Set&lt;String&gt; sortedSet = new TreeSet&lt;String&gt;();
		sortedSet.add(&quot;Zebra&quot;);
		
		sortedSet.add(&quot;Elephant&quot;);
		assertArrayEquals(
			new String[]{&quot;Elephant&quot;,&quot;Zebra&quot;},
			sortedSet.toArray());
		
		sortedSet.add(&quot;Giraffe&quot;);
		assertArrayEquals(
			new String[]{&quot;Elephant&quot;,&quot;Giraffe&quot;,&quot;Zebra&quot;},
			sortedSet.toArray());
		
		sortedSet.add(&quot;Bear&quot;);
		assertArrayEquals(
			new String[]{&quot;Bear&quot;,&quot;Elephant&quot;,
									&quot;Giraffe&quot;,&quot;Zebra&quot;},
			sortedSet.toArray());
	}
</pre>
</li>
</ol>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/U_tqleDELxQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/java-sorted-collection/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[Java example programs and code]]></series:name>
	<feedburner:origLink>http://rithus.com/java-sorted-collection</feedburner:origLink></item>
		<item>
		<title>Java : BigDecimal Scale Example Program Code</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/E3BOLsgyu20/java-bigdecimal-scale</link>
		<comments>http://rithus.com/java-bigdecimal-scale#comments</comments>
		<pubDate>Sat, 15 Dec 2012 15:02:26 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/java-bigdecimal-scale</guid>
		<description><![CDATA[This entry is part 95 of 104 in the series Java example programs and codeBigDecimal scale indicates number of digits after decimal. Lets look at a couple of examples. BigDecimal is created with No digits after decimal. Its scale is 0. BigDecimal firstAmount = new BigDecimal(&#34;55&#34;); assertEquals(0, firstAmount.scale()); BigDecimal created with 2 digits after decimal. [...]]]></description>
				<content:encoded><![CDATA[<div class="seriesmeta">This entry is part 95 of 104 in the series <a href="http://rithus.com/tutorials/java-example-programs-source-code" class="series-10" title="Java example programs and code">Java example programs and code</a></div><p>BigDecimal scale indicates number of digits after decimal. Lets look at a couple of examples.		    </p>
<ol>
<li>BigDecimal is created with No digits after decimal. Its scale is 0.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [4];">
		BigDecimal firstAmount = 
						new BigDecimal(&quot;55&quot;);
		
		assertEquals(0, firstAmount.scale());
</pre>
</li>
<li>BigDecimal created with 2 digits after decimal. Its scale is 2
<pre class="brush: java; gutter: true; first-line: 1; highlight: [4];">
		BigDecimal secondAmount = 
						new BigDecimal(&quot;12.00&quot;);
		
		assertEquals(2, secondAmount.scale());
</pre>
</li>
<li>Scale of result of addition is that of larger of two operands. (uses BigDecimal&#8217;s declared above).
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
		BigDecimal additionResult = 
				firstAmount.add(secondAmount);
		
		assertEquals(2, additionResult.scale());
</pre>
</li>
<li>Its safe to specify scale and rounding when dividing BigDecimal values. Otherwise, an exception might be thrown.</li>
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
		BigDecimal firstAmount = 
					new BigDecimal(&quot;55&quot;);
		BigDecimal secondAmount = 
					new BigDecimal(&quot;12&quot;);

		//Scale - 4
		BigDecimal divisionResult = 
				firstAmount.divide(secondAmount, 
				4, BigDecimal.ROUND_UP); 
</pre>
</ol>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/E3BOLsgyu20" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/java-bigdecimal-scale/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[Java example programs and code]]></series:name>
	<feedburner:origLink>http://rithus.com/java-bigdecimal-scale</feedburner:origLink></item>
		<item>
		<title>Java : Rounding BigDecimal’s Example Program Code</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/LpzC6yoQ_nQ/java-rounding-bigdecimals</link>
		<comments>http://rithus.com/java-rounding-bigdecimals#comments</comments>
		<pubDate>Sat, 15 Dec 2012 15:02:26 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/java-rounding-bigdecimals</guid>
		<description><![CDATA[This entry is part 94 of 104 in the series Java example programs and codeIn this example, lets look at a few options available to round BigDecimal values. Example 1 : ROUND_UP assertEquals(new BigDecimal(&#34;59.56&#34;), new BigDecimal(&#34;59.551&#34;). setScale(2, BigDecimal.ROUND_UP)); Example 2 : ROUND_DOWN // Any fraction is truncated assertEquals(new BigDecimal(&#34;59.55&#34;), new BigDecimal(&#34;59.559&#34;). setScale(2, BigDecimal.ROUND_DOWN)); Example 3 [...]]]></description>
				<content:encoded><![CDATA[<div class="seriesmeta">This entry is part 94 of 104 in the series <a href="http://rithus.com/tutorials/java-example-programs-source-code" class="series-10" title="Java example programs and code">Java example programs and code</a></div><p>In this example, lets look at a few options available to round BigDecimal values.</p>
<ol>
<li> Example 1 : ROUND_UP
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
		assertEquals(new BigDecimal(&quot;59.56&quot;),
						new BigDecimal(&quot;59.551&quot;).
						setScale(2, BigDecimal.ROUND_UP));
</pre>
</li>
<li> Example 2 : ROUND_DOWN
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">

		// Any fraction is truncated
		assertEquals(new BigDecimal(&quot;59.55&quot;),
						new BigDecimal(&quot;59.559&quot;).
						setScale(2, BigDecimal.ROUND_DOWN));
</pre>
</li>
<li>Example 3 : ROUND_HALF_UP
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
		// Fraction &gt;=.5 is rounded up. others truncated
		assertEquals(new BigDecimal(&quot;59.56&quot;),
					new BigDecimal(&quot;59.555&quot;).
					setScale(2, BigDecimal.ROUND_HALF_UP));
		assertEquals(new BigDecimal(&quot;59.55&quot;),
					new BigDecimal(&quot;59.5549&quot;).
					setScale(2, BigDecimal.ROUND_HALF_UP));

</pre>
</li>
<li>Example 4 : ROUND_HALF_DOWN
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
		//fraction &lt;=.5 is truncated. others rounded up.
		assertEquals(new BigDecimal(&quot;59.55&quot;),
					new BigDecimal(&quot;59.555&quot;).
					setScale(2, BigDecimal.ROUND_HALF_DOWN));
		assertEquals(new BigDecimal(&quot;59.56&quot;),
					new BigDecimal(&quot;59.5551&quot;).
					setScale(2,	BigDecimal.ROUND_HALF_DOWN));
</pre>
</li>
</ol>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/LpzC6yoQ_nQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/java-rounding-bigdecimals/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[Java example programs and code]]></series:name>
	<feedburner:origLink>http://rithus.com/java-rounding-bigdecimals</feedburner:origLink></item>
		<item>
		<title>Java : Divide BigDecimal’s</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/CXTpKRTMeAM/java-divide-bigdecimals</link>
		<comments>http://rithus.com/java-divide-bigdecimals#comments</comments>
		<pubDate>Sat, 15 Dec 2012 15:02:26 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/java-divide-bigdecimals</guid>
		<description><![CDATA[This entry is part 93 of 104 in the series Java example programs and codeDividing BigDecimal&#8217;s is tricky business. Lets take a quick look at how to get good at it. Dividing BigDecimal&#8217;s without using the scale might result in ArithmeticException if the result is Non-terminating. BigDecimal never truncates a result unless its requested to. [...]]]></description>
				<content:encoded><![CDATA[<div class="seriesmeta">This entry is part 93 of 104 in the series <a href="http://rithus.com/tutorials/java-example-programs-source-code" class="series-10" title="Java example programs and code">Java example programs and code</a></div><p>Dividing BigDecimal&#8217;s is tricky business. Lets take a quick look at how to get good at it.</p>
<ol>
<li> Dividing BigDecimal&#8217;s without using the scale might result in ArithmeticException if the result is Non-terminating.
<p>BigDecimal never truncates a result unless its requested to.</p>
<pre class="brush: java; gutter: true; first-line: 1; highlight: [1,12];">
	@Test(expected = ArithmeticException.class)
	public void bigDecimalDivisionException() {
		BigDecimal firstAmount = 
						new BigDecimal(&quot;55&quot;);
		BigDecimal secondAmount = 
						new BigDecimal(&quot;12&quot;);

		// java.lang.ArithmeticException: 
		// Non-terminating decimal expansion;
		// no exact representable decimal result.
		BigDecimal divisionResult = 
					firstAmount.divide(secondAmount);
	}
</pre>
</li>
<li>Safest way to divide BigDecimals is to specify scale and rounding parameter as shown in the example below.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	@Test
	public void bigDecimalDivide() {
		BigDecimal firstAmount = 
					new BigDecimal(&quot;55&quot;);
		BigDecimal secondAmount = 
					new BigDecimal(&quot;12&quot;);

		//Scale 4
		BigDecimal divisionResult = 
					firstAmount.divide(secondAmount, 
							4, BigDecimal.ROUND_UP);
		
		assertEquals(new BigDecimal(&quot;4.5834&quot;), divisionResult);
	}

</pre>
</li>
<li> There are varied kind of Rounding parameters available with BigDecimal. Couple of examples below.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
		BigDecimal divisionResultScale2Roundup = 
						firstAmount.divide(secondAmount, 
						2, BigDecimal.ROUND_UP);

		BigDecimal divisionResultScale2Rounddown = 
						firstAmount.divide(secondAmount, 
						2, BigDecimal.ROUND_DOWN);

		assertEquals(new BigDecimal(&quot;4.59&quot;), 
						divisionResultScale2Roundup);
		
		assertEquals(new BigDecimal(&quot;4.58&quot;), 
						divisionResultScale2Rounddown);
</pre>
</li>
</ol>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/CXTpKRTMeAM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/java-divide-bigdecimals/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[Java example programs and code]]></series:name>
	<feedburner:origLink>http://rithus.com/java-divide-bigdecimals</feedburner:origLink></item>
		<item>
		<title>Java : Add BigDecimal values</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/cCRIFszOfaI/java-add-bigdecimal-values</link>
		<comments>http://rithus.com/java-add-bigdecimal-values#comments</comments>
		<pubDate>Mon, 10 Dec 2012 15:02:26 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/java-add-bigdecimal-values</guid>
		<description><![CDATA[This entry is part 92 of 104 in the series Java example programs and codeAdding BigDecimals can be done using the add method. Lets look at a quick example. The scale of the result is the maximum of the scales of the operands. @Test public void bigDecimalsAddition() { BigDecimal firstAmount = new BigDecimal(&#34;2.300&#34;);// 3 BigDecimal [...]]]></description>
				<content:encoded><![CDATA[<div class="seriesmeta">This entry is part 92 of 104 in the series <a href="http://rithus.com/tutorials/java-example-programs-source-code" class="series-10" title="Java example programs and code">Java example programs and code</a></div><p>Adding BigDecimals can be done using the add method. Lets look at a quick example.</p>
<ol>
<li> The scale of the result is the maximum of the scales of the operands.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	@Test
	public void bigDecimalsAddition() {
		BigDecimal firstAmount = new BigDecimal(&quot;2.300&quot;);// 3
		BigDecimal secondAmount = new BigDecimal(&quot;2.45&quot;);// 2

		BigDecimal sum = firstAmount.add(secondAmount);
		BigDecimal sumScale2 = sum.setScale(2);

		assertEquals(new BigDecimal(&quot;4.75&quot;), sumScale2);
		assertEquals(new BigDecimal(&quot;4.750&quot;), sum);
	}

</pre>
</li>
</ol>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/cCRIFszOfaI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/java-add-bigdecimal-values/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[Java example programs and code]]></series:name>
	<feedburner:origLink>http://rithus.com/java-add-bigdecimal-values</feedburner:origLink></item>
		<item>
		<title>Java : Compare BigDecimal</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/N3YpAB8ISuM/java-compare-bigdecimal</link>
		<comments>http://rithus.com/java-compare-bigdecimal#comments</comments>
		<pubDate>Mon, 10 Dec 2012 15:02:26 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/java-compare-bigdecimal</guid>
		<description><![CDATA[This entry is part 91 of 104 in the series Java example programs and codeLets take a quick look at the Options available to Compare BigDecimal objects. Equals method is not the best bet to compare BigDecimals. The below comparison uses assertFalse. assertFalse(new BigDecimal(&#34;2.3&#34;). equals(new BigDecimal(&#34;2.30&#34;))); Best way to compare BigDecimal&#8217;s is to use compareTo [...]]]></description>
				<content:encoded><![CDATA[<div class="seriesmeta">This entry is part 91 of 104 in the series <a href="http://rithus.com/tutorials/java-example-programs-source-code" class="series-10" title="Java example programs and code">Java example programs and code</a></div><p>Lets take a quick look at the Options available to Compare BigDecimal objects. </p>
<ol>
<li>Equals method is not the best bet to compare BigDecimals. The below comparison uses assertFalse.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
		assertFalse(new BigDecimal(&quot;2.3&quot;).
						equals(new BigDecimal(&quot;2.30&quot;)));

</pre>
</li>
<li>Best way to compare BigDecimal&#8217;s is to use compareTo function. All possible result values of the compareTo are shown in the code below.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
		assertEquals(0, 
				new BigDecimal(&quot;2.3&quot;).compareTo(
				new BigDecimal(&quot;2.30&quot;)));
		
		assertEquals(1,
				new BigDecimal(&quot;2.31&quot;).compareTo(
				new BigDecimal(&quot;2.30&quot;)));
		
		assertEquals(-1,
				new BigDecimal(&quot;2.29&quot;).compareTo(
				new BigDecimal(&quot;2.3&quot;)));
</pre>
</li>
</ol>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/N3YpAB8ISuM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/java-compare-bigdecimal/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[Java example programs and code]]></series:name>
	<feedburner:origLink>http://rithus.com/java-compare-bigdecimal</feedburner:origLink></item>
		<item>
		<title>Java : Concatenate Strings</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/jjjlwnuPKvk/java-concatenate-strings</link>
		<comments>http://rithus.com/java-concatenate-strings#comments</comments>
		<pubDate>Mon, 10 Dec 2012 15:02:26 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/java-concatenate-strings</guid>
		<description><![CDATA[This entry is part 90 of 104 in the series Java example programs and codeLets take a quick look at the two options available in Java to concatenate Strings. Example 1 : Uses + operator to concatenate Strings. @Test public void concatenateStrings() { String string1 = &#34;Sachin &#34;; String string2 = &#34;Tendulkar&#34;; String concatenatedString = [...]]]></description>
				<content:encoded><![CDATA[<div class="seriesmeta">This entry is part 90 of 104 in the series <a href="http://rithus.com/tutorials/java-example-programs-source-code" class="series-10" title="Java example programs and code">Java example programs and code</a></div><p>Lets take a quick look at the two options available in Java to concatenate Strings.</p>
<ol>
<li>Example 1 : Uses + operator to concatenate Strings.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	@Test
	public void concatenateStrings() {
		String string1 = &quot;Sachin &quot;;
		String string2 = &quot;Tendulkar&quot;;
		String concatenatedString = string1 
									+ string2;
		assertEquals(&quot;Sachin Tendulkar&quot;, 
						concatenatedString);
	}
</pre>
</li>
<li>Example 2 : Uses String function Concat.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	@Test
	public void concatenateStringsApproach2() {
		String string1 = &quot;Sachin &quot;;
		String string2 = &quot;Tendulkar&quot;;
		String concatenatedString = 
						string1.concat(string2);
		assertEquals(&quot;Sachin Tendulkar&quot;, 
						concatenatedString);
	}

</pre>
</li>
</ol>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/jjjlwnuPKvk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/java-concatenate-strings/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[Java example programs and code]]></series:name>
	<feedburner:origLink>http://rithus.com/java-concatenate-strings</feedburner:origLink></item>
		<item>
		<title>Java : Remove last character from String</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/RcNSzjx_IE0/java-remove-last-character-from-string</link>
		<comments>http://rithus.com/java-remove-last-character-from-string#comments</comments>
		<pubDate>Mon, 10 Dec 2012 15:02:26 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/java-remove-last-character-from-string</guid>
		<description><![CDATA[This entry is part 89 of 104 in the series Java example programs and codeQuick example to remove last character from a String Use substring function to get the first length &#8211; 1 characters of the string. @Test public void removeLastCharacterFromString() { String str = &#34;COOLSTUFF&#34;; // Replace O with empty string &#34;&#34; String strWithLastCharacterRemoved [...]]]></description>
				<content:encoded><![CDATA[<div class="seriesmeta">This entry is part 89 of 104 in the series <a href="http://rithus.com/tutorials/java-example-programs-source-code" class="series-10" title="Java example programs and code">Java example programs and code</a></div><ol>Quick example to remove last character from a String</p>
<li> Use substring function to get the first length &#8211; 1 characters of the string.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	@Test
	public void removeLastCharacterFromString() {
		String str = &quot;COOLSTUFF&quot;;
		// Replace O with empty string &quot;&quot;
		String strWithLastCharacterRemoved = 
				str.substring(0, str.length() - 1);
		assertEquals(&quot;COOLSTUF&quot;, 
					strWithLastCharacterRemoved);
	}

</pre>
</li>
</ol>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/RcNSzjx_IE0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/java-remove-last-character-from-string/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[Java example programs and code]]></series:name>
	<feedburner:origLink>http://rithus.com/java-remove-last-character-from-string</feedburner:origLink></item>
		<item>
		<title>Java : Convert String to int, double and char</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/oYO_VNZXo_E/java-convert-string-to-int-double-and-char</link>
		<comments>http://rithus.com/java-convert-string-to-int-double-and-char#comments</comments>
		<pubDate>Mon, 10 Dec 2012 15:02:26 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/java-convert-string-to-int-double-and-char</guid>
		<description><![CDATA[This entry is part 88 of 104 in the series Java example programs and code Example 1 : Convert String to Character object @Test public void stringToCharacter() { String oneCharacterString = &#34;A&#34;; char char1 = oneCharacterString.charAt(0); Character character = Character.valueOf(char1); assertEquals(new Character(&#039;A&#039;), character); } Example 2 : Convert String to Char @Test public void stringToChar() [...]]]></description>
				<content:encoded><![CDATA[<div class="seriesmeta">This entry is part 88 of 104 in the series <a href="http://rithus.com/tutorials/java-example-programs-source-code" class="series-10" title="Java example programs and code">Java example programs and code</a></div><ol>
<li>Example 1 : Convert String to Character object
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	@Test
	public void stringToCharacter() {
		String oneCharacterString = &quot;A&quot;;
		char char1 = oneCharacterString.charAt(0);
		Character character = Character.valueOf(char1);
		assertEquals(new Character(&#039;A&#039;), character);
	}
</pre>
</li>
<li>Example 2 : Convert String to Char
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	@Test
	public void stringToChar() {
		String oneCharacterString = &quot;A&quot;;
		char character = oneCharacterString.charAt(0);
		assertEquals(&#039;A&#039;, character);
	}
</pre>
</li>
<li>Example 3 : Convert String to Double
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	@Test
	public void stringToDouble() {
		String doubleAsString = &quot;25.25&quot;;

		// If you want a Wrapper number - this is the best way
		Double numberWrapper = Double.valueOf(doubleAsString);
		assertEquals(25.25, numberWrapper.doubleValue(), 0.00);

		// If you want a primitive int - this is the best way
		double numberPrimitive = Double.parseDouble(doubleAsString);
		assertEquals(25.25, numberPrimitive, 0.00);
	}

</pre>
</li>
<li> Example 4 : Convert String to integer
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	@Test
	public void stringToInt() {
		String intAsString = &quot;25&quot;;
		// If you want a primitive int - this is the best way
		int numberPrimitive = Integer.parseInt(intAsString);
		assertEquals(25, numberPrimitive);
	}
</pre>
</li>
</ol>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/oYO_VNZXo_E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/java-convert-string-to-int-double-and-char/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[Java example programs and code]]></series:name>
	<feedburner:origLink>http://rithus.com/java-convert-string-to-int-double-and-char</feedburner:origLink></item>
		<item>
		<title>Java : Convert String to Date/Calendar</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/gS-xCeVPEpk/java-convert-string-to-datecalendar</link>
		<comments>http://rithus.com/java-convert-string-to-datecalendar#comments</comments>
		<pubDate>Wed, 05 Dec 2012 15:02:26 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/java-convert-string-to-datecalendar</guid>
		<description><![CDATA[This entry is part 87 of 104 in the series Java example programs and codeQuick Example to Convert a String to Date and/or Calendar. Simplest way is to use SimpleDateFormat to create a date and then use calendar.setTime to set the date into calendar. Source code below. @Test public void stringToDate() throws ParseException { String [...]]]></description>
				<content:encoded><![CDATA[<div class="seriesmeta">This entry is part 87 of 104 in the series <a href="http://rithus.com/tutorials/java-example-programs-source-code" class="series-10" title="Java example programs and code">Java example programs and code</a></div><p>Quick Example to Convert a String to Date and/or Calendar. </p>
<ol>
<li>Simplest way is to use SimpleDateFormat to create a date and then use calendar.setTime to set the date into calendar. Source code below.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	@Test
	public void stringToDate() throws ParseException {
		String dateString = &quot;August 15, 2011&quot;;

		//Create a date
		Date date = 
			new SimpleDateFormat(&quot;MMMM d, yyyy&quot;, 
									Locale.ENGLISH)
				.parse(dateString);
		
		//Create a calendar and set teim
		Calendar calendar = new GregorianCalendar();
		calendar.setTime(date);

		assertEquals(15, 
					calendar.get(Calendar.DATE));
		
		assertEquals(Calendar.AUGUST, 
					calendar.get(Calendar.MONTH));
		
		assertEquals(2011, 
					calendar.get(Calendar.YEAR));
	}
</pre>
</li>
</ol>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/gS-xCeVPEpk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/java-convert-string-to-datecalendar/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[Java example programs and code]]></series:name>
	<feedburner:origLink>http://rithus.com/java-convert-string-to-datecalendar</feedburner:origLink></item>
		<item>
		<title>Java : Searching a String</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/ONFfiVsvbI8/java-searching-a-string</link>
		<comments>http://rithus.com/java-searching-a-string#comments</comments>
		<pubDate>Wed, 05 Dec 2012 15:02:26 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/java-searching-a-string</guid>
		<description><![CDATA[This entry is part 86 of 104 in the series Java example programs and codeLets take a quick peek at various methods available in Java to search a string. Lets quickly create a String to search in. String string = &#34;Sachin Tendulkar&#34;; // 0123456789012345 First Method to search a string is contains. // Search for [...]]]></description>
				<content:encoded><![CDATA[<div class="seriesmeta">This entry is part 86 of 104 in the series <a href="http://rithus.com/tutorials/java-example-programs-source-code" class="series-10" title="Java example programs and code">Java example programs and code</a></div><p>Lets take a quick peek at various methods available in Java to search a string.</p>
<ol>
<li> Lets quickly create a String to search in.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
		String string = &quot;Sachin Tendulkar&quot;;
					  // 0123456789012345
</pre>
</li>
<li> First Method to search a string is contains.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
		// Search for a sequence of characters
		assertTrue(string.contains(&quot;in&quot;));
		assertFalse(string.contains(&quot;notin&quot;));
</pre>
</li>
<li>Get index of the first character that matches the search sequence using indexOf.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
		// Get index of character sequence
		assertEquals(2, string.indexOf(&quot;ch&quot;));
		// -1 Not found
		assertEquals(-1, string.indexOf(&quot;notin&quot;));
</pre>
</li>
<li>Search for the last occurance of a character sequence using lastIndexOf.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
		// If you want to search for last character
		assertEquals(14, string.lastIndexOf(&quot;a&quot;));
</pre>
</li>
</ol>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/ONFfiVsvbI8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/java-searching-a-string/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[Java example programs and code]]></series:name>
	<feedburner:origLink>http://rithus.com/java-searching-a-string</feedburner:origLink></item>
		<item>
		<title>Java : String Replace All – Regex</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/EffBCGk52xw/java-string-replace-all-regex</link>
		<comments>http://rithus.com/java-string-replace-all-regex#comments</comments>
		<pubDate>Wed, 05 Dec 2012 15:02:26 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/java-string-replace-all-regex</guid>
		<description><![CDATA[This entry is part 85 of 104 in the series Java example programs and codeLets look at couple of quick examples of Replace All on a String using a Regular Expression (Regex). First example : @Test public void stringReplaceAllRegex() { String string = &#34;Replace all numbers 6 in 7 string 8&#34;; //Regex matches all numeric [...]]]></description>
				<content:encoded><![CDATA[<div class="seriesmeta">This entry is part 85 of 104 in the series <a href="http://rithus.com/tutorials/java-example-programs-source-code" class="series-10" title="Java example programs and code">Java example programs and code</a></div><p>Lets look at couple of quick examples of Replace All on a String using a Regular Expression (Regex).		    </p>
<ol>
<li> First example :
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	@Test
	public void stringReplaceAllRegex() {
		String string = 
				&quot;Replace all numbers 6 in 7 string 8&quot;;

		//Regex matches all numeric characters
		String regularExpression = &quot;[0-9]&quot;;

		String stringToReplaceWith = &quot;X&quot;;

		assertEquals(&quot;Replace all numbers X in X string X&quot;,
				string.replaceAll(
					regularExpression, 
					stringToReplaceWith));
	}
</pre>
</li>
<li> Example 2 : Difference between String Replace and Replace All.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	@Test
	public void stringReplaceAndReplaceAllDifference() {
		String string = 
			&quot;Replace all 5 numbers 6 in 7 string 8&quot;;

		// Regex matches all numeric characters
		String regularExpression = &quot;[0-9]&quot;;

		String stringToReplaceWith = &quot;X&quot;;

		// Replace all looks for regular expression
		assertEquals(
			&quot;Replace all X numbers X in X string X&quot;,
			string.replaceAll(regularExpression, 
								stringToReplaceWith));

		// Replace looks for the actual string. 
		// Since &quot;[0-9]&quot; is not found,
		// it does not replace anything
		assertEquals(
			&quot;Replace all 5 numbers 6 in 7 string 8&quot;,
			string.replace(regularExpression, 
								stringToReplaceWith));

	}

</pre>
</li>
</ol>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/EffBCGk52xw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/java-string-replace-all-regex/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[Java example programs and code]]></series:name>
	<feedburner:origLink>http://rithus.com/java-string-replace-all-regex</feedburner:origLink></item>
		<item>
		<title>Java : Replace String (also Characters)</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/uMUSATo-K6g/java-replace-string-also-characters</link>
		<comments>http://rithus.com/java-replace-string-also-characters#comments</comments>
		<pubDate>Wed, 05 Dec 2012 15:02:26 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/java-replace-string-also-characters</guid>
		<description><![CDATA[This entry is part 84 of 104 in the series Java example programs and codeLets look at couple of quick examples : Replacing String in a String and Replacing Character in a String. Example 1: Replacing String in a String @Test public void stringReplace() { String string = &#34;Gavaskar is India&#039;s best Batsman&#34;; String stringToReplace [...]]]></description>
				<content:encoded><![CDATA[<div class="seriesmeta">This entry is part 84 of 104 in the series <a href="http://rithus.com/tutorials/java-example-programs-source-code" class="series-10" title="Java example programs and code">Java example programs and code</a></div><p>Lets look at couple of quick examples : Replacing String in a String and Replacing Character in a String.</p>
<ol>
<li>Example 1: Replacing String in a String
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	@Test
	public void stringReplace() {
		String string = &quot;Gavaskar is India&#039;s best Batsman&quot;;
		String stringToReplace = &quot;Gavaskar&quot;;
		String stringToReplaceWith = &quot;Sachin&quot;;

		assertEquals(&quot;Sachin is India&#039;s best Batsman&quot;,
				string.replace(stringToReplace, 
								stringToReplaceWith));
	}
</pre>
</li>
<li> Example 2 : Replace Character in a String
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	@Test
	public void replaceCharacterInString() {
		String string = &quot;TESTING&quot;;
		char charToReplace = &#039;T&#039;;
		char charToReplaceWith = &#039;$&#039;;

		assertEquals(&quot;$ES$ING&quot;,
					string.replace(charToReplace, 
							charToReplaceWith));
	}
</pre>
</li>
</ol>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/uMUSATo-K6g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/java-replace-string-also-characters/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[Java example programs and code]]></series:name>
	<feedburner:origLink>http://rithus.com/java-replace-string-also-characters</feedburner:origLink></item>
		<item>
		<title>Java : Split String</title>
		<link>http://feedproxy.google.com/~r/RithusTutorials/~3/HHYq4d2e1kY/java-split-string</link>
		<comments>http://rithus.com/java-split-string#comments</comments>
		<pubDate>Wed, 05 Dec 2012 15:02:26 +0000</pubDate>
		<dc:creator>Ranga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rithus.com/java-split-string</guid>
		<description><![CDATA[This entry is part 83 of 104 in the series Java example programs and codeQuick Example of how to Split Strings in Java. We make use of the split method available on a String object. Source code below. @Test public void splitStrings() { String stringToSplit = &#34;1,2,3,4&#34;; String seperator = &#34;,&#34;; String[] splits = stringToSplit.split(seperator); [...]]]></description>
				<content:encoded><![CDATA[<div class="seriesmeta">This entry is part 83 of 104 in the series <a href="http://rithus.com/tutorials/java-example-programs-source-code" class="series-10" title="Java example programs and code">Java example programs and code</a></div><p>Quick Example of how to Split Strings in Java. </p>
<ol>
<li>We make use of the split method available on a String object. Source code below.
<pre class="brush: java; gutter: true; first-line: 1; highlight: [];">
	@Test
	public void splitStrings() {
		String stringToSplit = &quot;1,2,3,4&quot;;
		String seperator = &quot;,&quot;;

		String[] splits = stringToSplit.split(seperator);

		int noOfSplitFragments = 4;
		
		assertEquals(noOfSplitFragments, splits.length);

		assertArrayEquals(
					new String[] { &quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot; }, 
					splits);
	}
</pre>
</li>
</ol>
<img src="http://feeds.feedburner.com/~r/RithusTutorials/~4/HHYq4d2e1kY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rithus.com/java-split-string/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[Java example programs and code]]></series:name>
	<feedburner:origLink>http://rithus.com/java-split-string</feedburner:origLink></item>
	</channel>
</rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

 Served from: rithus.com @ 2013-06-19 00:06:11 by W3 Total Cache -->
