<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Java Tutorials</title>
	<atom:link href="http://malliktalksjava.in/feed/" rel="self" type="application/rss+xml" />
	<link>http://malliktalksjava.in</link>
	<description>The Premium tutorials from Mallik</description>
	<lastBuildDate>Tue, 24 Jan 2012 17:52:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='malliktalksjava.in' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Java Tutorials</title>
		<link>http://malliktalksjava.in</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://malliktalksjava.in/osd.xml" title="Java Tutorials" />
	<atom:link rel='hub' href='http://malliktalksjava.in/?pushpress=hub'/>
		<item>
		<title>equals() and hashCode() methods of Object Class</title>
		<link>http://malliktalksjava.in/2012/01/24/equals-and-hashcode-methods-of-object-class/</link>
		<comments>http://malliktalksjava.in/2012/01/24/equals-and-hashcode-methods-of-object-class/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 17:52:51 +0000</pubDate>
		<dc:creator>mallikarjungunda</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[hashcode()]]></category>
		<category><![CDATA[HashMap]]></category>
		<category><![CDATA[Hashtable]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Set (computer science)]]></category>

		<guid isPermaLink="false">http://malliktalksjava.in/?p=374</guid>
		<description><![CDATA[HashTable, HashMap and HashSet are the Collection classes in java.util package that make use of hashing algorithm to store objects. In all these Collection classes except HashSet, objects are stored as key-value pairs. For the storage and the retrieval of any user-defined objects it is a good practice to override the following methods which is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=malliktalksjava.in&amp;blog=13165077&amp;post=374&amp;subd=malliktalksjava&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>HashTable, HashMap and HashSet are the Collection classes in java.util package that make use of hashing algorithm to store objects. In all these Collection classes except HashSet, objects are stored as key-value pairs. For the storage and the retrieval of any user-defined objects it is a good <span style="text-decoration:underline;">practice</span> to override the following methods which is mentioned below,</p>
<ul>
<li><strong><em>hashCode()</em></strong></li>
<li><strong><em>equals()</em></strong></li>
</ul>
<p>These methods are available in the Object class and hence available to all <span style="text-decoration:underline;">java classes</span>.Using these two methods, an object can be stored or retrieved from a Hashtable, HashMap or HashSet.</p>
<p><strong>hashCode() method</strong></p>
<p>This method returns a hashcode value as an int for the object. Default implementation for hashcode() should be overridden in order to make <span style="text-decoration:underline;">searching</span> of data faster. The implementation of hashCode() method for an user-defined object should be calculated based on the <span style="text-decoration:underline;">properties</span> of the class which we wish to consider.</p>
<p><strong>equals() method</strong></p>
<p>This method returns a boolean which specifies whether two objects are equal or not. The default implementation of equals() method given by the Object Class uses the &#8216;==&#8217; operator to compare two object <span style="text-decoration:underline;">references</span>, and returns true only if they refer to the same object. But, we can meaningfully re-define this equals() method to have en equality check based on our own criterias.</p>
<p>Consider the following code, which defines two user defined classes Employee and EmployeeId which are supposed to be stored in a Map.</p>
<p><strong>Employee.java</strong></p>
<p>&nbsp;</p>
<p>public class Employee {</p>
<p>private String name;</p>
<p>public Employee(String name){</p>
<p>this.name = name;</p>
<p>}</p>
<p>public String toString(){</p>
<p>return name;</p>
<p>}</p>
<p>}</p>
<p><strong>EmployeeId.java</strong></p>
<p>&nbsp;</p>
<p>public class EmployeeId {</p>
<p>private String id;</p>
<p>public EmployeeId(String id){</p>
<p>this.id = id;</p>
<p>}</p>
<p>public String toString(){</p>
<p>return id;</p>
<p>}</p>
<p>}</p>
<p>The following class makes use of the above classes by storing it in a Map for later retrieval. We are adding Employee objects into the Map keyed with Employee Id.</p>
<p><strong>HashCodeTest.java</strong></p>
<p>&nbsp;</p>
<p>public class HashCodeTest {</p>
<p>public static void main(String[] args) {</p>
<p>Map&lt;EmployeeId, Employee&gt; employees = new HashMap&lt;EmployeeId, Employee&gt;();</p>
<p>employees.put(new EmployeeId(&#8220;111&#8243;), <span style="text-decoration:underline;">new Employee</span>(&#8220;Johny&#8221;));</p>
<p>employees.put(new EmployeeId(&#8220;222&#8243;), new Employee(&#8220;Jeny&#8221;)); // Line A</p>
<p>employees.put(new EmployeeId(&#8220;333&#8243;), new Employee(&#8220;Jessie&#8221;));</p>
<p>Employee emp =  employees.get(new EmployeeId(&#8220;222&#8243;)); // Line B</p>
<p>System.out.println(emp); // Line C</p>
<p>}</p>
<p>}</p>
<p>In Line B, we try to retrieve the Employee object who has Employee Id with a value of 222. We expect the output to be <strong><em>&#8216;Jeny&#8217;</em></strong>, because the Employee with Employee Id (222) was already there in the Collection, but surprisingly, the output of the above code is <strong><em>null</em></strong>. The reason is that we did not override the equals() method for EmployeeId and Employee classes because the default implementation of equals() in the Object class considers the new EmployeeId(&#8220;222&#8243;) in the put statement and new EmployeeId(&#8220;222&#8243;) in the get statement as two different instances, and hence the call to get() in Line B returns null.</p>
<p>Let us look at how the same code works when we provide our desired implementation for hashcode() and equals() methods. We basically override hashcode() here just to make the object to be searched fast.</p>
<p><strong>Employee.java</strong></p>
<p>&nbsp;</p>
<p>public class Employee {</p>
<p>private String name;</p>
<p>public Employee(String name){</p>
<p>this.name = name;</p>
<p>}</p>
<p>public String toString(){</p>
<p>return name;</p>
<p>}</p>
<p>&nbsp;</p>
<p>@Override</p>
<p>public boolean equals(Object obj){</p>
<p>if(obj == null) {</p>
<p>return false;</p>
<p>}</p>
<p>if(obj.getClass() != getClass()){</p>
<p>return false;</p>
<p>}</p>
<p>Employee emp = (Employee)obj;</p>
<p>if(this.name == emp.name){</p>
<p>return true;</p>
<p>}</p>
<p>return false;</p>
<p>}</p>
<p>@Override</p>
<p>public int hashCode(){</p>
<p>return name.hashCode();</p>
<p>}</p>
<p>}</p>
<p><strong>EmployeeId.java</strong></p>
<p>&nbsp;</p>
<p>public class EmployeeId {</p>
<p>private String id;</p>
<p>public EmployeeId(String id){</p>
<p>this.id = id;</p>
<p>}</p>
<p>public String toString(){</p>
<p>return id;</p>
<p>}</p>
<p>&nbsp;</p>
<p>public boolean equals(Object obj){</p>
<p>if(obj == null)</p>
<p>return false;</p>
<p>if(obj.getClass() != getClass()){</p>
<p>return false;</p>
<p>}</p>
<p>&nbsp;</p>
<p>EmployeeId empId = (EmployeeId)obj;</p>
<p>if(this.id == empId.id){</p>
<p>return true;</p>
<p>}</p>
<p>return false;</p>
<p>}</p>
<p>@Override</p>
<p>public int hashCode(){</p>
<p>return id.hashCode();</p>
<p>}</p>
<p>}</p>
<p>Now, we get the desired output &#8216;Jeny&#8217;, because as per our implementation for the equals() method, the new EmployeeId(&#8220;222&#8243;) in the put statement and new EmployeeId(&#8220;222&#8243;) in the get statement are considered one and the same.</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/malliktalksjava.wordpress.com/374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/malliktalksjava.wordpress.com/374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/malliktalksjava.wordpress.com/374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/malliktalksjava.wordpress.com/374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/malliktalksjava.wordpress.com/374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/malliktalksjava.wordpress.com/374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/malliktalksjava.wordpress.com/374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/malliktalksjava.wordpress.com/374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/malliktalksjava.wordpress.com/374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/malliktalksjava.wordpress.com/374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/malliktalksjava.wordpress.com/374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/malliktalksjava.wordpress.com/374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/malliktalksjava.wordpress.com/374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/malliktalksjava.wordpress.com/374/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=malliktalksjava.in&amp;blog=13165077&amp;post=374&amp;subd=malliktalksjava&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://malliktalksjava.in/2012/01/24/equals-and-hashcode-methods-of-object-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9ed11bca649c4a453f5107d2f882e787?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mallikarjungunda</media:title>
		</media:content>
	</item>
		<item>
		<title>Sorting of int values in an array</title>
		<link>http://malliktalksjava.in/2012/01/20/sorting-of-int-values-in-an-array/</link>
		<comments>http://malliktalksjava.in/2012/01/20/sorting-of-int-values-in-an-array/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 18:09:51 +0000</pubDate>
		<dc:creator>mallikarjungunda</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[sorting in java]]></category>
		<category><![CDATA[sorting of int array in java]]></category>

		<guid isPermaLink="false">http://malliktalksjava.in/?p=360</guid>
		<description><![CDATA[package in.javatutorials.test; public class ManualSorting { int[] arr = { 12, 1, 3, 22, 222, -9 }; public void ascendingOrder() { for (int i = 0; i &#60; arr.length; i++) { for (int j = i + 1; j &#60; arr.length; j++) { int temp = 0; if (arr[i] &#60; arr[j]) { temp = arr[j]; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=malliktalksjava.in&amp;blog=13165077&amp;post=360&amp;subd=malliktalksjava&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><code><code>package in.javatutorials.test;</code></code></p>
<p><code><code>public class ManualSorting {</code></code><br />
<code><code> int[] arr = { 12, 1, 3, 22, 222, -9 };</code></code><br />
<code><code> public void ascendingOrder() {</code></code><br />
<code><code> for (int i = 0; i &lt; arr.length; i++) {</code></code><br />
<code><code> for (int j = i + 1; j &lt; arr.length; j++) {</code></code><br />
<code><code> int temp = 0;</code></code><br />
<code><code> if (arr[i] &lt; arr[j]) {</code></code><br />
<code><code> temp = arr[j];</code></code><br />
<code><code> arr[j] = arr[i];</code></code><br />
<code><code> arr[i] = temp;</code></code><br />
<code><code> }</code></code><br />
<code><code> }</code></code><br />
<code><code> System.out.print(arr[i] + " ,");</code></code><br />
<code><code> }</code></code><br />
<code><code> System.out.println();</code></code><br />
<code><code> }</code></code><br />
<code><code> public void descendingOrder() {</code></code><br />
<code><code> for (int i = 0; i &lt; arr.length; i++) {</code></code><br />
<code><code> for (int j = i + 1; j &lt; arr.length; j++) {</code></code><br />
<code><code> int temp = 0;</code></code><br />
<code><code> if (arr[i] &gt; arr[j]) {</code></code><br />
<code><code> temp = arr[j];</code></code><br />
<code><code> arr[j] = arr[i];</code></code><br />
<code><code> arr[i] = temp;</code></code><br />
<code><code> }</code></code><br />
<code><code> }</code></code><br />
<code><code> System.out.print(arr[i] + " ,");</code></code><br />
<code><code> }</code></code><br />
<code><code> System.out.println();</code></code><br />
<code><code> }</code></code><br />
<code><code> public static void main(String arr[]) {</code></code><br />
<code><code> ManualSorting ms = new ManualSorting();</code></code><br />
<code><code> ms.ascendingOrder();</code></code><br />
<code><code> ms.descendingOrder();</code></code><br />
<code><code> }</code></code><br />
<code><code>}</code></code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/malliktalksjava.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/malliktalksjava.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/malliktalksjava.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/malliktalksjava.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/malliktalksjava.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/malliktalksjava.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/malliktalksjava.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/malliktalksjava.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/malliktalksjava.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/malliktalksjava.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/malliktalksjava.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/malliktalksjava.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/malliktalksjava.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/malliktalksjava.wordpress.com/360/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=malliktalksjava.in&amp;blog=13165077&amp;post=360&amp;subd=malliktalksjava&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://malliktalksjava.in/2012/01/20/sorting-of-int-values-in-an-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9ed11bca649c4a453f5107d2f882e787?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mallikarjungunda</media:title>
		</media:content>
	</item>
		<item>
		<title>Read Properties file in Java</title>
		<link>http://malliktalksjava.in/2012/01/20/read-properties-file-in-java/</link>
		<comments>http://malliktalksjava.in/2012/01/20/read-properties-file-in-java/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 18:08:00 +0000</pubDate>
		<dc:creator>mallikarjungunda</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[java properties file]]></category>
		<category><![CDATA[Read properties file in java]]></category>

		<guid isPermaLink="false">http://malliktalksjava.in/?p=358</guid>
		<description><![CDATA[package com.test; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.util.Enumeration; import java.util.Locale; import java.util.Properties; import java.util.ResourceBundle; public class ReadPropetiesFile { public static void main(String a[]){ String fileName = "test.properties"; ReadPropetiesFile readProp = new ReadPropetiesFile(); readProp.readProperties(fileName); } public void readProperties(String fileName){ try { ResourceBundle labels = ResourceBundle.getBundle(fileName, Locale.ENGLISH); Enumeration bundleKeys = labels.getKeys(); while (bundleKeys.hasMoreElements()) {    [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=malliktalksjava.in&amp;blog=13165077&amp;post=358&amp;subd=malliktalksjava&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><code><code>package com.test;</code></code><br />
<code><code>import java.io.File;</code></code><br />
<code><code>import java.io.FileInputStream;</code></code><br />
<code><code>import java.io.IOException;</code></code><br />
<code><code>import java.util.Enumeration;</code></code><br />
<code><code>import java.util.Locale;</code></code><br />
<code><code>import java.util.Properties;</code></code><br />
<code><code>import java.util.ResourceBundle;</code></code><br />
<code><code>public class ReadPropetiesFile {</code></code><br />
<code><code> public static void main(String a[]){</code></code><br />
<code><code> String fileName = "test.properties";</code></code><br />
<code><code> ReadPropetiesFile readProp = new ReadPropetiesFile();</code></code><br />
<code><code> readProp.readProperties(fileName); </code></code><br />
<code><code> } </code></code><br />
<code><code> public void readProperties(String fileName){</code></code><br />
<code><code> try {</code></code><br />
<code><code> ResourceBundle labels = ResourceBundle.getBundle(fileName, Locale.ENGLISH);</code></code><br />
<code><code> Enumeration bundleKeys = labels.getKeys();</code></code><br />
<code><code> while (bundleKeys.hasMoreElements()) {</code></code><br />
<code><code>     String key = (String)bundleKeys.nextElement();</code></code><br />
<code><code>     String value = labels.getString(key);</code></code><br />
<code><code>     System.out.println("key = " + key + ", " +   "value = " + value);</code></code><br />
<code><code> } </code></code><br />
<code><code> }catch (Exception e) {</code></code><br />
<code><code> e.printStackTrace();</code></code><br />
<code><code> }</code></code><br />
<code><code> }</code></code><br />
<code><code>}</code></code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/malliktalksjava.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/malliktalksjava.wordpress.com/358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/malliktalksjava.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/malliktalksjava.wordpress.com/358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/malliktalksjava.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/malliktalksjava.wordpress.com/358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/malliktalksjava.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/malliktalksjava.wordpress.com/358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/malliktalksjava.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/malliktalksjava.wordpress.com/358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/malliktalksjava.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/malliktalksjava.wordpress.com/358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/malliktalksjava.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/malliktalksjava.wordpress.com/358/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=malliktalksjava.in&amp;blog=13165077&amp;post=358&amp;subd=malliktalksjava&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://malliktalksjava.in/2012/01/20/read-properties-file-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9ed11bca649c4a453f5107d2f882e787?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mallikarjungunda</media:title>
		</media:content>
	</item>
		<item>
		<title>SAX Parser Example in JAVA</title>
		<link>http://malliktalksjava.in/2012/01/20/sax-parser-example-in-java/</link>
		<comments>http://malliktalksjava.in/2012/01/20/sax-parser-example-in-java/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 18:06:13 +0000</pubDate>
		<dc:creator>mallikarjungunda</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[lt xml]]></category>
		<category><![CDATA[saxparser]]></category>
		<category><![CDATA[test xml]]></category>
		<category><![CDATA[xml parsers]]></category>

		<guid isPermaLink="false">http://malliktalksjava.in/?p=355</guid>
		<description><![CDATA[package com.test; import java.io.StringReader; import java.util.Enumeration; import java.util.Locale; import java.util.ResourceBundle; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; public class ParseXMLUsingSAX { public static String xmlString = "&#60;?xml version='1.0'?&#62;&#60;EMPLOYEE&#62;&#60;USER_ID&#62;admin&#60;/USER_ID&#62;&#60;PASSWORD&#62;admin123&#60;/PASSWORD&#62;&#60;/EMPLOYEE&#62;"; public static void main(String argv[]) { String fileName = "D:\\test.xml"; parseXml(fileName); } public static void parseXml(String fileName){ try { SAXParserFactory factory = [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=malliktalksjava.in&amp;blog=13165077&amp;post=355&amp;subd=malliktalksjava&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><code>package com.test;</code><br />
<code>import java.io.StringReader;</code><br />
<code>import java.util.Enumeration;</code><br />
<code>import java.util.Locale;</code><br />
<code>import java.util.ResourceBundle;</code><br />
<code>import javax.xml.parsers.SAXParser;</code><br />
<code>import javax.xml.parsers.SAXParserFactory;</code><br />
<code>import org.xml.sax.Attributes;</code><br />
<code>import org.xml.sax.InputSource;</code><br />
<code>import org.xml.sax.SAXException;</code><br />
<code>import org.xml.sax.helpers.DefaultHandler;</code><br />
<code><br />
</code><br />
<code>public class ParseXMLUsingSAX { </code><br />
<code>public static String xmlString = "&lt;?xml version='1.0'?&gt;&lt;EMPLOYEE&gt;&lt;USER_ID&gt;admin&lt;/USER_ID&gt;&lt;PASSWORD&gt;admin123&lt;/PASSWORD&gt;&lt;/EMPLOYEE&gt;"; </code><br />
<code> public static void main(String argv[]) {</code><br />
<code> String fileName = "D:\\test.xml"; </code><br />
<code> parseXml(fileName);</code><br />
<code> } </code><br />
<code> public static void parseXml(String fileName){</code><br />
<code> try {</code><br />
<code> SAXParserFactory factory = SAXParserFactory.newInstance();</code><br />
<code> SAXParser saxParser = factory.newSAXParser();</code><br />
<code> InputSource is = new InputSource();</code><br />
<code> is.setCharacterStream(new StringReader(xmlString));</code><br />
<code> DefaultHandler handler = new DefaultHandler() { </code><br />
<code> boolean userID = false;</code><br />
<code> boolean password = false;</code><br />
<code> public void startElement(String uri, String localName, </code><br />
<code> String qName, Attributes attributes) t</code>hrows SAXException {<br />
<code> if (qName.equalsIgnoreCase("USER_ID")) {</code><br />
<code> userID = true;</code><br />
<code> }</code><br />
<code> if (qName.equalsIgnoreCase("PASSWORD")) {</code><br />
<code> password = true;</code><br />
<code> }</code><br />
<code> }</code><br />
<code> public void endElement(String uri, String localName,</code><br />
<code> String qName) throws SAXException {</code><br />
<code> }</code><br />
<code> public void characters(char ch[], int start, int length)</code> throws SAXException {<br />
<code> if (userID) {</code><br />
<code> System.out.println("userID : " </code>+ new String(ch, start, length));<br />
<code> userID = false;</code><br />
<code> }</code><br />
<code> if (password) {</code><br />
<code> System.out.println("password : " </code>+ new String(ch, start, length));<br />
<code> password = false;</code><br />
<code> }</code><br />
<code> }</code><br />
<code> };</code><br />
<code> //saxParser.parse(fileName, handler);</code><br />
<code> saxParser.parse(is, handler);</code><br />
<code> } catch (Exception e) {</code><br />
<code> e.printStackTrace();</code><br />
<code> }</code><br />
<code> }</code><br />
<code>}</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/malliktalksjava.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/malliktalksjava.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/malliktalksjava.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/malliktalksjava.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/malliktalksjava.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/malliktalksjava.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/malliktalksjava.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/malliktalksjava.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/malliktalksjava.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/malliktalksjava.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/malliktalksjava.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/malliktalksjava.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/malliktalksjava.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/malliktalksjava.wordpress.com/355/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=malliktalksjava.in&amp;blog=13165077&amp;post=355&amp;subd=malliktalksjava&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://malliktalksjava.in/2012/01/20/sax-parser-example-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9ed11bca649c4a453f5107d2f882e787?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mallikarjungunda</media:title>
		</media:content>
	</item>
		<item>
		<title>XML Parsing Example using DOM in Java</title>
		<link>http://malliktalksjava.in/2012/01/20/xml-parsing-example-using-dom-in-java/</link>
		<comments>http://malliktalksjava.in/2012/01/20/xml-parsing-example-using-dom-in-java/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 18:01:42 +0000</pubDate>
		<dc:creator>mallikarjungunda</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[w3c dom]]></category>
		<category><![CDATA[xml parsers]]></category>

		<guid isPermaLink="false">http://malliktalksjava.in/?p=352</guid>
		<description><![CDATA[package com.test; import java.io.StringReader; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.CharacterData; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.InputSource; public class XMLParsing {   public static void main(String arg[]) throws Exception{ String xmlRecords = &#8220;&#60;data&#62;&#60;employee&#62;&#60;name&#62;A&#60;/name&#62;&#8221; + &#8220;&#60;title&#62;Manager&#60;/title&#62;&#60;/employee&#62;&#60;/data&#62;&#8221;;     DocumentBuilder db = DocumentBuilderFactory.newInstance(). newDocumentBuilder();     InputSource is = new InputSource();     is.setCharacterStream(new [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=malliktalksjava.in&amp;blog=13165077&amp;post=352&amp;subd=malliktalksjava&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><code>package com.test;</code><br />
<code><br />
</code><br />
<code>import java.io.StringReader;</code><br />
<code>import javax.xml.parsers.DocumentBuilder;</code><br />
<code>import javax.xml.parsers.DocumentBuilderFactory;</code><br />
<code>import org.w3c.dom.CharacterData;</code><br />
<code>import org.w3c.dom.Document;</code><br />
<code>import org.w3c.dom.Element;</code><br />
<code>import org.w3c.dom.Node;</code><br />
<code>import org.w3c.dom.NodeList;</code><br />
<code>import org.xml.sax.InputSource;</code><br />
<code>public class XMLParsing {</code><br />
<code>  public static void main(String arg[]) throws Exception{</code></p>
<p>String xmlRecords = &#8220;&lt;data&gt;&lt;employee&gt;&lt;name&gt;A&lt;/name&gt;&#8221;<br />
+ &#8220;&lt;title&gt;Manager&lt;/title&gt;&lt;/employee&gt;&lt;/data&gt;&#8221;;<br />
<code><br />
</code><br />
<code>    DocumentBuilder db = DocumentBuilderFactory.newInstance().</code><br />
<code> newDocumentBuilder();</code><br />
<code>    InputSource is = new InputSource();</code><br />
<code>    is.setCharacterStream(new StringReader(xmlRecords));</code><br />
<code><br />
</code><br />
<code>    Document doc = db.parse(is);</code><br />
<code>    NodeList nodes = doc.getElementsByTagName("employee");</code><br />
<code><br />
</code><br />
<code>    for (int i = 0; i &lt; nodes.getLength(); i++) {</code><br />
<code>      Element element = (Element) nodes.item(i);</code><br />
<code><br />
</code><br />
<code>      NodeList name = element.getElementsByTagName("name");</code><br />
<code>      Element line = (Element) name.item(0);</code><br />
<code>      System.out.println("Name: " + getCharacterDataFromElement(line));</code><br />
<code><br />
</code><br />
<code>      NodeList title = element.getElementsByTagName("title");</code><br />
<code>      line = (Element) title.item(0);</code><br />
<code>      System.out.println("Title: " + getCharacterDataFromElement(line));</code><br />
<code>    }</code><br />
<code>  }</code><br />
<code>  public static String getCharacterDataFromElement(Element e) {</code><br />
<code>    Node child = e.getFirstChild();</code><br />
<code>    if (child instanceof CharacterData) {</code><br />
<code>      CharacterData cd = (CharacterData) child;</code><br />
<code>      return cd.getData();</code><br />
<code>    }</code><br />
<code>    return "";</code><br />
<code>  }</code><br />
<code>}</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/malliktalksjava.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/malliktalksjava.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/malliktalksjava.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/malliktalksjava.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/malliktalksjava.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/malliktalksjava.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/malliktalksjava.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/malliktalksjava.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/malliktalksjava.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/malliktalksjava.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/malliktalksjava.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/malliktalksjava.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/malliktalksjava.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/malliktalksjava.wordpress.com/352/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=malliktalksjava.in&amp;blog=13165077&amp;post=352&amp;subd=malliktalksjava&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://malliktalksjava.in/2012/01/20/xml-parsing-example-using-dom-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9ed11bca649c4a453f5107d2f882e787?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mallikarjungunda</media:title>
		</media:content>
	</item>
		<item>
		<title>Introduction to RESTful Web Services</title>
		<link>http://malliktalksjava.in/2012/01/16/introduction-to-restful-web-services/</link>
		<comments>http://malliktalksjava.in/2012/01/16/introduction-to-restful-web-services/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 18:39:30 +0000</pubDate>
		<dc:creator>mallikarjungunda</dc:creator>
				<category><![CDATA[Web Services]]></category>
		<category><![CDATA[apache http server]]></category>
		<category><![CDATA[apache http server project]]></category>
		<category><![CDATA[architectural principles]]></category>
		<category><![CDATA[representational state transfer]]></category>
		<category><![CDATA[style services]]></category>
		<category><![CDATA[uniform interface]]></category>

		<guid isPermaLink="false">http://malliktalksjava.in/?p=349</guid>
		<description><![CDATA[REST is a “Representational state transfer” and it is firstly introduced by Roy Fielding (Fielding is one of the principal authors of the HTTP specification and a co-founder of the Apache HTTP Server project) in his 2000 doctoral dissertation. REST-style services (i.e., RESTful services) adhere to a set of constraints and architectural principles that include [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=malliktalksjava.in&amp;blog=13165077&amp;post=349&amp;subd=malliktalksjava&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>REST is a “Representational state transfer” and it is firstly introduced by Roy Fielding (Fielding is one of the principal authors of the HTTP specification and a co-founder of the Apache HTTP Server project) in his 2000 doctoral dissertation.</p>
<p>REST-style services (i.e., RESTful services) adhere to a set of constraints and architectural principles that include the following:</p>
<ol>
<li>RESTful services are stateless. As Fielding writes in Section 5.1.3 of his thesis, “each request from client to server must contain all the information necessary to understand the request, and cannot take advantage of any stored context on the server.”</li>
<li>RESTful services have a uniform interface. This constraint is usually taken to mean that the only allowed operations are the HTTP operations: GET, POST, PUT, and DELETE.</li>
<li>REST-based architectures are built from resources (pieces of information) that are uniquely identified by URIs. For example, in a RESTful purchasing system, each purchase order has a unique URI.</li>
</ol>
<p>REST components manipulate resources by exchanging representations of the resources. For example, a purchase order resource can be represented by an XML document. Within a RESTful purchasing system, a purchase order might be updated by posting an XML document containing the changed purchase order to its URI</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/malliktalksjava.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/malliktalksjava.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/malliktalksjava.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/malliktalksjava.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/malliktalksjava.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/malliktalksjava.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/malliktalksjava.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/malliktalksjava.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/malliktalksjava.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/malliktalksjava.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/malliktalksjava.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/malliktalksjava.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/malliktalksjava.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/malliktalksjava.wordpress.com/349/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=malliktalksjava.in&amp;blog=13165077&amp;post=349&amp;subd=malliktalksjava&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://malliktalksjava.in/2012/01/16/introduction-to-restful-web-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9ed11bca649c4a453f5107d2f882e787?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mallikarjungunda</media:title>
		</media:content>
	</item>
		<item>
		<title>Happy to share 2011 in review</title>
		<link>http://malliktalksjava.in/2012/01/04/happy-to-share-2011-in-review/</link>
		<comments>http://malliktalksjava.in/2012/01/04/happy-to-share-2011-in-review/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 05:44:59 +0000</pubDate>
		<dc:creator>mallikarjungunda</dc:creator>
				<category><![CDATA[About Me]]></category>

		<guid isPermaLink="false">http://malliktalksjava.in/?p=346</guid>
		<description><![CDATA[The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog. Here&#8217;s an excerpt: The concert hall at the Syndey Opera House holds 2,700 people. This blog was viewed about 15,000 times in 2011. If it were a concert at Sydney Opera House, it would take about 6 sold-out performances for that many [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=malliktalksjava.in&amp;blog=13165077&amp;post=346&amp;subd=malliktalksjava&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog.</p>
<p><a href="/2011/annual-report/"><img src="http://www.wordpress.com/wp-content/mu-plugins/annual-reports/img/emailteaser.jpg" alt="" width="100%" /></a></p>
<p>Here&#8217;s an excerpt:</p>
<blockquote><p>The concert hall at the Syndey Opera House holds 2,700 people. This blog was viewed about <strong>15,000</strong> times in 2011. If it were a concert at Sydney Opera House, it would take about 6 sold-out performances for that many people to see it.</p></blockquote>
<p><a href="/2011/annual-report/">Click here to see the complete report.</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/malliktalksjava.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/malliktalksjava.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/malliktalksjava.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/malliktalksjava.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/malliktalksjava.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/malliktalksjava.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/malliktalksjava.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/malliktalksjava.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/malliktalksjava.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/malliktalksjava.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/malliktalksjava.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/malliktalksjava.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/malliktalksjava.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/malliktalksjava.wordpress.com/346/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=malliktalksjava.in&amp;blog=13165077&amp;post=346&amp;subd=malliktalksjava&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://malliktalksjava.in/2012/01/04/happy-to-share-2011-in-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9ed11bca649c4a453f5107d2f882e787?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mallikarjungunda</media:title>
		</media:content>

		<media:content url="http://www.wordpress.com/wp-content/mu-plugins/annual-reports/img/emailteaser.jpg" medium="image" />
	</item>
		<item>
		<title>Interface in Java</title>
		<link>http://malliktalksjava.in/2011/07/24/interface-in-java/</link>
		<comments>http://malliktalksjava.in/2011/07/24/interface-in-java/#comments</comments>
		<pubDate>Sun, 24 Jul 2011 16:05:21 +0000</pubDate>
		<dc:creator>mallikarjungunda</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[Abstract type]]></category>
		<category><![CDATA[inheritance]]></category>
		<category><![CDATA[Interface (Java)]]></category>
		<category><![CDATA[interface in java]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[java interffaces]]></category>

		<guid isPermaLink="false">http://malliktalksjava.wordpress.com/?p=342</guid>
		<description><![CDATA[Interfaces can be used to implement the Inheritance relationship between the non-related classes that do not belongs to the same hierarchy, i.e. any Class and any where in hierarchy.  Using Interface, you can specify what a class must do but not how it does. A class can implement more than one Interface. An Interface can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=malliktalksjava.in&amp;blog=13165077&amp;post=342&amp;subd=malliktalksjava&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Interfaces can be used to implement the <a class="zem_slink" title="Inheritance (object-oriented programming)" href="http://en.wikipedia.org/wiki/Inheritance_%28object-oriented_programming%29" rel="wikipedia">Inheritance</a> relationship between the non-related classes that do not belongs to the same hierarchy, i.e. any <a class="zem_slink" title="Class (computer programming)" href="http://en.wikipedia.org/wiki/Class_%28computer_programming%29" rel="wikipedia">Class</a> and any where in hierarchy.  Using <a class="zem_slink" title="Interface (Java)" href="http://en.wikipedia.org/wiki/Interface_%28Java%29" rel="wikipedia">Interface</a>, you can specify what a class must do but not how it does.</p>
<ol>
<li>A class can implement more than one Interface.</li>
<li>An Interface can extend one or more interfaces, by using the keyword <em>extends</em>.</li>
<li>All the data members in the interface are public, static and <a class="zem_slink" title="Final (Java)" href="http://en.wikipedia.org/wiki/Final_%28Java%29" rel="wikipedia">Final</a> by default.</li>
<li>An Interface method can have only Public, default and <a class="zem_slink" title="Abstract type" href="http://en.wikipedia.org/wiki/Abstract_type" rel="wikipedia">Abstract</a> modifiers&#8230;. <strong><a title="Interface in Java" href="http://mallikarjungunda.blogspot.com/2011/05/interface-in-java.html">More</a></strong></li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/malliktalksjava.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/malliktalksjava.wordpress.com/342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/malliktalksjava.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/malliktalksjava.wordpress.com/342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/malliktalksjava.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/malliktalksjava.wordpress.com/342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/malliktalksjava.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/malliktalksjava.wordpress.com/342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/malliktalksjava.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/malliktalksjava.wordpress.com/342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/malliktalksjava.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/malliktalksjava.wordpress.com/342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/malliktalksjava.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/malliktalksjava.wordpress.com/342/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=malliktalksjava.in&amp;blog=13165077&amp;post=342&amp;subd=malliktalksjava&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://malliktalksjava.in/2011/07/24/interface-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9ed11bca649c4a453f5107d2f882e787?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mallikarjungunda</media:title>
		</media:content>
	</item>
		<item>
		<title>Servlet Lifecycle</title>
		<link>http://malliktalksjava.in/2011/07/24/servlet-lifecycle/</link>
		<comments>http://malliktalksjava.in/2011/07/24/servlet-lifecycle/#comments</comments>
		<pubDate>Sun, 24 Jul 2011 16:00:13 +0000</pubDate>
		<dc:creator>mallikarjungunda</dc:creator>
				<category><![CDATA[Servlet]]></category>
		<category><![CDATA[Java Servlet]]></category>
		<category><![CDATA[Web server]]></category>

		<guid isPermaLink="false">http://malliktalksjava.wordpress.com/?p=337</guid>
		<description><![CDATA[A servlet is a small Java program that runs within a Web server. Servlets receive and respond to requests from Web clients, usually across HTTP, the HyperText Transfer Protocol. The methods which are used to initialize a servlet, to service requests, and to remove a servlet from the server are called servlet life cycle methods. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=malliktalksjava.in&amp;blog=13165077&amp;post=337&amp;subd=malliktalksjava&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>A <a class="zem_slink" title="Java Servlet" href="http://en.wikipedia.org/wiki/Java_Servlet" rel="wikipedia">servlet</a> is a small <a class="zem_slink" title="Java (programming language)" href="http://www.oracle.com/technetwork/java/" rel="homepage">Java</a> program that runs within a <a class="zem_slink" title="Web server" href="http://en.wikipedia.org/wiki/Web_server" rel="wikipedia">Web server</a>. Servlets receive and respond to requests from Web clients, usually across HTTP, the HyperText Transfer Protocol.</div>
<div>The methods which are used to initialize a servlet, to service requests, and to remove a servlet from the server are called servlet life cycle methods. These are three methods namely<strong> init(), service(), destroy()&#8230; <a title="Servlet Life cycle" href="http://mallikarjungunda.blogspot.com/2011/05/servlet-life-cycle.html">More</a></strong></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/malliktalksjava.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/malliktalksjava.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/malliktalksjava.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/malliktalksjava.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/malliktalksjava.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/malliktalksjava.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/malliktalksjava.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/malliktalksjava.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/malliktalksjava.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/malliktalksjava.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/malliktalksjava.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/malliktalksjava.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/malliktalksjava.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/malliktalksjava.wordpress.com/337/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=malliktalksjava.in&amp;blog=13165077&amp;post=337&amp;subd=malliktalksjava&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://malliktalksjava.in/2011/07/24/servlet-lifecycle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9ed11bca649c4a453f5107d2f882e787?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mallikarjungunda</media:title>
		</media:content>
	</item>
		<item>
		<title>Abstract class in Java</title>
		<link>http://malliktalksjava.in/2011/07/24/abstract-class-in-java/</link>
		<comments>http://malliktalksjava.in/2011/07/24/abstract-class-in-java/#comments</comments>
		<pubDate>Sun, 24 Jul 2011 15:57:56 +0000</pubDate>
		<dc:creator>mallikarjungunda</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[difference between interface and abstract class]]></category>
		<category><![CDATA[Java abstract class]]></category>

		<guid isPermaLink="false">http://malliktalksjava.wordpress.com/?p=335</guid>
		<description><![CDATA[Abstract class is class which has more than one abstract method which doesn’t have method body but at least one of its methods need to be implemented  in derived Class. Abstract classes can be used to implement the inheritance relationship between the classes that belongs same hierarchy&#8230;. More<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=malliktalksjava.in&amp;blog=13165077&amp;post=335&amp;subd=malliktalksjava&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Abstract class is class which has more than one <a class="zem_slink" title="Method (computer programming)" href="http://en.wikipedia.org/wiki/Method_%28computer_programming%29" rel="wikipedia">abstract method</a> which doesn’t have method body but at least one of its methods need to be implemented  in derived Class.<br />
Abstract classes can be used to implement the inheritance relationship between the classes that belongs <em>same</em> hierarchy&#8230;. <a title="Abstract class in Java" href="http://mallikarjungunda.blogspot.com/2011/05/abstract-class-in-java.html"><strong>More</strong></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/malliktalksjava.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/malliktalksjava.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/malliktalksjava.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/malliktalksjava.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/malliktalksjava.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/malliktalksjava.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/malliktalksjava.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/malliktalksjava.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/malliktalksjava.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/malliktalksjava.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/malliktalksjava.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/malliktalksjava.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/malliktalksjava.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/malliktalksjava.wordpress.com/335/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=malliktalksjava.in&amp;blog=13165077&amp;post=335&amp;subd=malliktalksjava&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://malliktalksjava.in/2011/07/24/abstract-class-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9ed11bca649c4a453f5107d2f882e787?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mallikarjungunda</media:title>
		</media:content>
	</item>
	</channel>
</rss>
