<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Java Programming Forum - Learn Java Programming - Blogs - Advanced Java</title>
		<link>http://www.java-forums.org/blogs/advanced-java/</link>
		<description>Java Programming Forum - Learning Java easily</description>
		<language>en</language>
		<lastBuildDate>Sat, 18 May 2013 13:47:39 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.java-forums.org/images/misc/rss.jpg</url>
			<title>Java Programming Forum - Learn Java Programming - Blogs - Advanced Java</title>
			<link>http://www.java-forums.org/blogs/advanced-java/</link>
		</image>
		<item>
			<title>Java Exception Classes</title>
			<link>http://www.java-forums.org/blogs/advanced-java/882-java-exception-classes.html</link>
			<pubDate>Sat, 18 Feb 2012 15:17:31 GMT</pubDate>
			<description>Java exceptions are basically java objects. An object is thrown when you throw a java exception. It is not possible to throw any object as an...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">Java exceptions are basically java objects. An object is thrown when you throw a java exception. It is not possible to throw any object as an exception. Only those objects whose classes descend from Throwable.<br />
Throwable serves as the base class for all classes and it is declared in java.lang. Your program can instantiate and throw it. <br />
<br />
Following picture shows a part of this family.<br />
<div style="text-align: center;"><br />
<img src="http://www.java-forums.org/attachment.php?attachmentid=3061&amp;d=1329578197" border="0" alt="Name:  1.JPG
Views: 508
Size:  19.8 KB" class="thumbnail" style="float:CONFIG" /><br />
<b>Java Exception Classes</b></div><br />
As it is shown in the figure, Throwable has two direct subclasses.<br />
<br />
•	Exception<br />
•	Error<br />
<br />
Exceptions are thrown to signal abnormal conditions and it can be handled by the try catch block. <br />
Errors are thrown for serious issues like OutOfMemoryError and are not easy to handle.</blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/882-java-exception-classes.html</guid>
		</item>
		<item>
			<title>Checked and Unchecked Exceptions</title>
			<link>http://www.java-forums.org/blogs/advanced-java/881-checked-unchecked-exceptions.html</link>
			<pubDate>Sat, 18 Feb 2012 15:14:49 GMT</pubDate>
			<description>*Checked exceptions:* Programmers are facilitated by checked Exceptions so that to dealings with exceptions which could be thrown. Exception class...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore"><b>Checked exceptions:</b> Programmers are facilitated by checked Exceptions so that to dealings with exceptions which could be thrown. Exception class has sub classes. Checked Exception examples are:<br />
<br />
•	Arithmatic exception<br />
<br />
In a method when checked exception takes place, either program caught it or it passes to caller program.<br />
<br />
<b>Unchecked exceptions:</b> They are RuntimeException. Class Errors and subclasses  of it are also unchecked. <br />
<br />
Example: ArrayIndexOutOfBounds Exception. <br />
<br />
Exception Statement Syntax<br />
<br />
Use try-catch-finally construct to handle Exceptions, which consist of the Syntax<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to explain exception handling in java</div>

	<pre class="brush: java">try {
&lt;code&gt;
} catch (&lt;exception type1&gt; &lt;parameter1&gt;) { // 0 or more
&lt;statements&gt;
}
} finally { // finally block
&lt;statements&gt;
}</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 </blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/881-checked-unchecked-exceptions.html</guid>
		</item>
		<item>
			<title>Java Exceptions</title>
			<link>http://www.java-forums.org/blogs/advanced-java/880-java-exceptions.html</link>
			<pubDate>Sat, 18 Feb 2012 15:12:30 GMT</pubDate>
			<description><![CDATA[Any unexpected, abnormal & extra-ordinary condition which occurs in Java program at runtime is known as Exception. Examples of events or conditions...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">Any unexpected, abnormal &amp; extra-ordinary condition which occurs in Java program at runtime is known as Exception. Examples of events or conditions are as following:<br />
<br />
•	Not able to get the “connection exception”<br />
•	“File not found” exception<br />
<br />
In all these conditions, throw an exception object. Such exceptions are considered to be the Java objects. A java error exception can’t be escaped.<br />
<br />
Error conditions are being handled by the Java Exception handling by taking necessary systematic actions in a program. Specific exceptions are handled by the Exception handlers or group of exceptions could be handled by the help of generic exception handler. In other case when exceptions of a program are not handled then Java runtime environment would be handling it.<br />
<br />
Exception is Error class’s subclass which are the Throwable class’s subclass. Throw keyword raises Java exceptions and catch block handles it.</blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/880-java-exceptions.html</guid>
		</item>
		<item>
			<title>Java Collection Subtypes</title>
			<link>http://www.java-forums.org/blogs/advanced-java/879-java-collection-subtypes.html</link>
			<pubDate>Sat, 18 Feb 2012 15:10:54 GMT</pubDate>
			<description>Collection interface subtypes are given below. They all makes the collection interface extended. 
 
1.	List 
2.	Queue 
3.	SortedSet 
4.	Set...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">Collection interface subtypes are given below. They all makes the collection interface extended.<br />
<br />
1.	List<br />
2.	Queue<br />
3.	SortedSet<br />
4.	Set<br />
5.	NavigableSet<br />
6.	Deque  <br />
<br />
One of its subtypes shall be used when Collection interface are needed to be used. At Collection interface, implementation is not supported by Java. Just a set of methods are present in it. Specific Collection types are ignored by it.<br />
<br />
To operate at a Collection, use this method:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to explain collection types</div>

	<pre class="brush: java">public class CollectionUtil{
  public static void performSomething(Collection collection) {
    Iterator iterator = collection.iterator();
    while(iterator.hasNext()){
      Object object = iterator.next();
      //do something to object here...
    }
  }
}
//By using subtypes of Collection, this method is called: 
Set  set  = new HashSet();
List list = new ArrayList();

CollectionUtil.performSomething(set);
CollectionUtil.performSomething(list);</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 </blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/879-java-collection-subtypes.html</guid>
		</item>
		<item>
			<title>Checking if a Collection Contains a Certain Element</title>
			<link>http://www.java-forums.org/blogs/advanced-java/878-checking-if-collection-contains-certain-element.html</link>
			<pubDate>Sat, 18 Feb 2012 15:08:55 GMT</pubDate>
			<description>In collection interface, 2 methods have been implemented to check if certain elements are present in it. Two methods are as following: 
...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">In collection interface, 2 methods have been implemented to check if certain elements are present in it. Two methods are as following:<br />
<br />
1.	contains()<br />
2.	containsAll()<br />
<br />
This code explains these 2 methods:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to explain the contains and containsAll methods</div>

	<pre class="brush: java">Collection collection   = new HashSet();
boolean containsElement = collection.contains(&quot;an element&quot;);

Collection elements     = new HashSet();
boolean containsAll     = collection.containsAll(elements);</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 contains() returns true, when elements are present in collection, &amp; false if not. <br />
containsAll() returns true when contains all the elements are present in the parameter collection &amp; false if not.</blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/878-checking-if-collection-contains-certain-element.html</guid>
		</item>
		<item>
			<title>Iterating a Collection</title>
			<link>http://www.java-forums.org/blogs/advanced-java/877-iterating-collection.html</link>
			<pubDate>Sat, 18 Feb 2012 15:07:06 GMT</pubDate>
			<description>Collection’s all elements are iteration is done by getting an iterator from collection. Use the iterator through collection. 
 
It is explained by...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">Collection’s all elements are iteration is done by getting an iterator from collection. Use the iterator through collection.<br />
<br />
It is explained by this given code:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to explain the collection iteration</div>

	<pre class="brush: java">Collection myCollection = new HashSet();
//... add elements to the collection

Iterator iterator = myCollection.iterator();
while(iterator.hasNext()){
    Object object = iterator.next();
    //do something to object;    
}

//You can also use the new for-loop: 

Collection myCollection = new HashSet();
//... add elements to the collection

for(Object object : collection) {
  //do something to object;
}</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 </blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/877-iterating-collection.html</guid>
		</item>
		<item>
			<title>Using Collections.sort and Comparator in Java</title>
			<link>http://www.java-forums.org/blogs/advanced-java/876-using-collections-sort-comparator-java.html</link>
			<pubDate>Sat, 18 Feb 2012 15:05:18 GMT</pubDate>
			<description>Sorting a collection in Java is easy, just use Collections.sort(Collection) to sort your values. For example: 
Collection sorting is easier in Java....</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">Sorting a collection in Java is easy, just use Collections.sort(Collection) to sort your values. For example:<br />
Collection sorting is easier in Java. To sort the values, use Collection.sort (Collection). E.g<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to explain collection sort and comparator methods</div>

	<pre class="brush: java">import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class SimpleSort {
    public static void main(String&#91;&#93; args) {
        List list = new ArrayList();
        list.add(5);
        list.add(4);
        list.add(3);
        list.add(7);
        list.add(2);
        list.add(1);
        Collections.sort(list);
        for (Integer integer : list) {
            System.out.println(integer);
        }
    }
}</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 </blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/876-using-collections-sort-comparator-java.html</guid>
		</item>
		<item>
			<title>The Collection Classes</title>
			<link>http://www.java-forums.org/blogs/advanced-java/875-collection-classes.html</link>
			<pubDate>Sat, 18 Feb 2012 15:03:37 GMT</pubDate>
			<description>Standard collection classes are provided by the Java which does the implementation of the Collection interfaces. Few classes give full...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">Standard collection classes are provided by the Java which does the implementation of the Collection interfaces. Few classes give full implementations that are being used as the abstract class, skeletal implementations are provided which are the starting points to make the concrete collections.<br />
<br />
Here is the list given of standard collection classes.<br />
<br />
<ul><li style="">AbstractCollection: Collection interfaces are implemented by it.</li><li style="">AbstractList: Extension of AbstractCollection is done. Implementation of the majority of the List interface.</li><li style="">AbstractSequentialList: Extension of the AbstractList is done to be used by a collection which will use a sequential access instead of random access of elements.</li><li style="">LinkedList: By extension of AbstractSequentialList, a linked list is implemented.</li><li style="">ArrayList: By extenstion of the AbstractList, a dynamic array is implemented.</li><li style="">AbstractSet: Extension of the AbstractCollection is done by it and also implements Set interfaces.</li><li style="">HashSet: Extension of the AbstractSet to be used along with a hash table.</li><li style="">LinkedHashSet: Extension of the HashSet so that to permit the insertion-order iterations.</li><li style="">TreeSet: Implementation of a set that has been stored in a tree. Extension of the AbstractSet is done.</li><li style="">AbstractMap: Map interfaces are implemented.</li></ul></blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/875-collection-classes.html</guid>
		</item>
		<item>
			<title>Java Interfaces</title>
			<link>http://www.java-forums.org/blogs/advanced-java/874-java-interfaces.html</link>
			<pubDate>Sat, 18 Feb 2012 15:02:28 GMT</pubDate>
			<description>Core collection interfaces are shown in this figure, which are basically encapsulated by various collections. Such interfaces are used for...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">Core collection interfaces are shown in this figure, which are basically encapsulated by various collections. Such interfaces are used for manipulation of maintenance of the interfaces, independent of details. Core collection interfaces are taken as the basis of Java collection Framework.<br />
<br />
Core collection interfaces are detailed by this list:<br />
<br />
<ul><li style="">Collection —a collection presents objects group which are known as its elements.</li><li style="">Set — a collection in which duplicate elements are not present.</li><li style="">List — an ordered collection, sometimes known as a sequence. Duplicate elements could be present in a List.</li><li style="">Queue — a collection for holding the multiple elements before processing.</li><li style="">Map — a Map doesn’t hold duplicate keys. Every key could map to 1 value.</li></ul></blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/874-java-interfaces.html</guid>
		</item>
		<item>
			<title>Benefits of the Java Collections Framework</title>
			<link>http://www.java-forums.org/blogs/advanced-java/873-benefits-java-collections-framework.html</link>
			<pubDate>Sat, 18 Feb 2012 15:01:10 GMT</pubDate>
			<description>Java Collections Framework offers these benefits: 
 
 
* Reducing the efforts of Programming: Useful data structures and algorithms are present in...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">Java Collections Framework offers these benefits:<br />
<br />
<ul><li style="">Reducing the efforts of Programming: Useful data structures and algorithms are present in Collection Framework. Built in data structures time and efforts of a programmer gets reduced. It also allows you interoperability to the other APIs. There is no need of conversion codes or writing of the adapter objects.</li><li style="">Increase speed and quality of program: Higher quality algorithms, high performance and data structures are provided by the Java collection Framework. Application gets tuned by switching of the implementations of collections. This makes you free to write customized codes or algorithms. More time is provided to do the improvement of your program.</li><li style="">Interoperability b/w APIs: With various APIs, collection interfaces might operate efficiently. If node name collection is furnished by network administration API or if column heading is expected by GUI toolkit, API seamlessly will be interoperated, even they were independently written.</li><li style="">Lesser effort for learning and using new APIs: There is no need present of learning newer APIs. Collection interfaces are taken as an input by APIs and furnish as output.</li></ul></blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/873-benefits-java-collections-framework.html</guid>
		</item>
		<item>
			<title>Collections Framework</title>
			<link>http://www.java-forums.org/blogs/advanced-java/872-collections-framework.html</link>
			<pubDate>Sat, 18 Feb 2012 14:59:48 GMT</pubDate>
			<description>Unified architecture to manipulate and present the collections is known as collections framework. Following is present in all collections framework:...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">Unified architecture to manipulate and present the collections is known as collections framework. Following is present in all collections framework:<br />
<br />
<ul><li style=""><b>Interfaces:</b>  Interfaces present the collections and are considered to be an abstract data type. Connections are allowed by interfaces to be manipulated independent of their presentation details. A hierarchy is formed by interface in the object oriented language.</li><li style=""><b>Implementations:</b> They are collection interface’s concrete implementation. They are considered as those data structures which can be reused.</li><li style=""><b>Algorithms:</b> Useful computations are performed by these methods.For example sorting &amp; searching on objects at which collection interfaces get implemented.  Algorithms are polymorphic which means that similar method could be used for implementation of the collection interfaces.</li></ul></blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/872-collections-framework.html</guid>
		</item>
		<item>
			<title><![CDATA[Java Generic's Wildcards]]></title>
			<link>http://www.java-forums.org/blogs/advanced-java/871-java-generics-wildcards.html</link>
			<pubDate>Sat, 18 Feb 2012 14:57:51 GMT</pubDate>
			<description>Consider a situation where you desire all List elements to be printed. This could be explained by the given code: 
 
public void...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">Consider a situation where you desire all List elements to be printed. This could be explained by the given code:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to explain printing of all elements</div>

	<pre class="brush: java">public void processElements(List&lt;Object&gt; elements){
   for(Object o : elements){
      System.out.println(o);
   }
}</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 This method couldn’t be used along with List&lt;String&gt; instance. To sort out this problem, wildcard operator is used. For writing generic List by the help of wildcard operator, use this code.<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to explain wildcard operator</div>

	<pre class="brush: java">List&lt;?&gt; listOfUnknown = new ArrayList&lt;?&gt;();    
//ProcessElements() method could be defined as following: 
public void processElements(List&lt;?&gt; elements){
   for(Object o : elements){
      System.out.println(o);
   }
}
//ProcessElements() could be called with any kind of generified List instance. For Example: 
List&lt;String&gt; elements = new ArrayList&lt;String&gt;
// ... add String elements to the list.
processElements(elements);</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 </blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/871-java-generics-wildcards.html</guid>
		</item>
		<item>
			<title>Java Generic Methods</title>
			<link>http://www.java-forums.org/blogs/advanced-java/870-java-generic-methods.html</link>
			<pubDate>Sat, 18 Feb 2012 14:55:09 GMT</pubDate>
			<description><![CDATA[It is also possible and supported to generify methods in Java.  
 
 
public static <T> T add(T element, Collection<T> collection){ 
   ...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">It is also possible and supported to generify methods in Java. <br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to expalin generic methods</div>

	<pre class="brush: java">public static &lt;T&gt; T add(T element, Collection&lt;T&gt; collection){
    collection.add(element);
    return element;
}</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 A type T is being specified by this method. It is used as generic type of collection as well as for element parameter type.<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code: </div>

	<pre class="brush: java">String stringElement = &quot;stringElement&quot;;
List&lt;String&gt; stringList = new ArrayList&lt;String&gt;();
String theElement = add(stringElement, stringList);    
Integer integerElement = new Integer(123);
List&lt;Integer&gt; integerList = new ArrayList&lt;Integer&gt;();
Integer theElement = add(integerElement, integerList);</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 The given call is also considered legal: <br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code: </div>

	<pre class="brush: java">String stringElement = &quot;stringElement&quot;;
List&lt;Object&gt; objectList = new ArrayList&lt;Object&gt;();
Object theElement = add(stringElement, objectList);</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 Though, its inverse is not considered legal: <br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code: </div>

	<pre class="brush: java">Object objectElement = new Object();
List&lt;String&gt; stringList = new ArrayList&lt;String&gt;();
Object theElement = add(objectElement, stringList);</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 </blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/870-java-generic-methods.html</guid>
		</item>
		<item>
			<title>Generic Classes in Java</title>
			<link>http://www.java-forums.org/blogs/advanced-java/869-generic-classes-java.html</link>
			<pubDate>Sat, 18 Feb 2012 14:52:20 GMT</pubDate>
			<description>Your Java classes could also be generified. Generics are not restricted or bound to any pre-defined classes of Java. This is also applicable to...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">Your Java classes could also be generified. Generics are not restricted or bound to any pre-defined classes of Java. This is also applicable to customized written classes of Java.<br />
<br />
Simple generic class is explained here by this code.<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to explain generic class</div>

	<pre class="brush: java">public class GenericTestFactory&lt;E&gt; {
    Class myClass = null;
    public GenericTestFactory(Class myClass) {
        this.myClass = myClass;
    }
    public E createInstance()
    throws IllegalAccessException, InstantiationException {
        return (E) this.myClass.newInstance();
    }
}</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 The &lt;E&gt; is considered to be a type token.This shows that class might have a type set, when instantiated. Example is as following:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to expalin generic type casting</div>

	<pre class="brush: java">GenericTestFactory&lt;MyClass&gt; factory =
    new GenericTestFactory&lt;MyClass&gt;(MyClass.class);
MyClass myClassInstance = factory.createInstance();</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 Every GenerticTestFactory instance might get generified into varying types. Two examples are present here.<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to explain the generified</div>

	<pre class="brush: java">GenericTestFactory&lt;MyClass&gt; factory =
    new GenericTestFactory&lt;MyClass&gt;(MyClass.class);
MyClass myClassInstance = factory.createInstance();
GenericTestFactory&lt;SomeObject&gt; factory =
    new GenericTestFactory&lt;SomeObject&gt;(SomeObject.class);
SomeObject someObjectInstance = factory.createInstance();</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 </blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/869-generic-classes-java.html</guid>
		</item>
		<item>
			<title>Generic Map in Java</title>
			<link>http://www.java-forums.org/blogs/advanced-java/868-generic-map-java.html</link>
			<pubDate>Sat, 18 Feb 2012 14:49:06 GMT</pubDate>
			<description>It is possible to generify java.util.Map. Instances of Map in such cases could be of a specific type. Instances of that type in that case could be...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">It is possible to generify java.util.Map. Instances of Map in such cases could be of a specific type. Instances of that type in that case could be only inserted as well read, from that Map.<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to explain Generic Map</div>

	<pre class="brush: java">Map&lt;Integer, String&gt; set = new HashMap&lt;Integer, String&gt;;</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 This Map just can now accept string instances to be as values and Integer instances to be as Keys.<br />
<br />
<b>Accessing a Generic Map</b><br />
<br />
Following code could be used for addition of String to generic map.<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to explain addition of String to generic map</div>

	<pre class="brush: java">Map&lt;Integer, String&gt; map = new HashMap&lt;Integer, String&gt;;
Integer key1   = new Integer(123);
String  value1 = &quot;value 1&quot;;
map.put(key1, value1);
String value1_1 = map.get(key1);</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 <b>Iterating a Generic Map</b><br />
<br />
Over generic map, following code would iterate:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to explain iteration over generic map</div>

	<pre class="brush: java">Map&lt;Integer, String&gt; map = new HashMap&lt;Integer, String&gt;;
Iterator&lt;Integer&gt; keyIterator   = map.keySet().iterator();
while(keyIterator.hasNext()){
  Integer aKey   = iterator.next();
  String  aValue = map.get(aKey);
}

Iterator&lt;String&gt;  valueIterator = map.values().iterator();
while(valueIterator.hasNext()){
  String aString = valueIterator.next();
}</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 </blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/868-generic-map-java.html</guid>
		</item>
		<item>
			<title>Generic Set in Java</title>
			<link>http://www.java-forums.org/blogs/advanced-java/867-generic-set-java.html</link>
			<pubDate>Sat, 18 Feb 2012 14:45:57 GMT</pubDate>
			<description>It is also possible to generify the java.util.Set. Set instances in these cases might of a specific type.  
 
Instances of that type in such cases...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">It is also possible to generify the java.util.Set. Set instances in these cases might of a specific type. <br />
<br />
Instances of that type in such cases could be inserted or read, from that set.<br />
<br />
Usage of generic Set is explained here.<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to explain usage of generic Set</div>

	<pre class="brush: java">Set&lt;String&gt; set = new HashSet&lt;String&gt;;</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 <b>Adding Elements to a Generic Set</b><br />
<br />
To a set, specific String type is added by using this code.<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to add specific String type in a Set</div>

	<pre class="brush: java">Set&lt;String&gt; set = new HashSet&lt;String&gt;;
String string1 = &quot;a string&quot;;
set.add(string1);</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 <b>Iterating a Generic Set</b><br />
<br />
To iterate over  generic Set, use this code:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to iterate over  generic Set </div>

	<pre class="brush: java">Set&lt;String&gt; set = new HashSet&lt;String&gt;;
Iterator&lt;String&gt; iterator = set.iterator();
while(iterator.hasNext()){
  String aString = iterator.next();
}</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 </blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/867-generic-set-java.html</guid>
		</item>
		<item>
			<title>Generic List in Java</title>
			<link>http://www.java-forums.org/blogs/advanced-java/866-generic-list-java.html</link>
			<pubDate>Sat, 18 Feb 2012 14:43:00 GMT</pubDate>
			<description>It is possible to do the generification of java.util.List. This shows that List instances might be of a specific type. That type of instances in such...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">It is possible to do the generification of java.util.List. This shows that List instances might be of a specific type. That type of instances in such cases could only be read from List.<br />
<br />
Generic List is explained by this code.<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to expalin Generic List declaration</div>

	<pre class="brush: java">List&lt;String&gt; list = new ArrayList&lt;String&gt;;</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 String instances can be stored by this list. <br />
<br />
Exists are being checked just at the compilation time by this generic type.<br />
<br />
<b>Accessing a Generic List</b><br />
<br />
To retrieve or add a String to a generic list, use this code.<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to retrieve or add a String to a generic list</div>

	<pre class="brush: java">List&lt;String&gt; list = new ArrayList&lt;String&gt;;
String string = &quot;my string&quot;;
list.add(string);
string2 = list.get(0);</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 <b>Iterating a Generic List</b><br />
<br />
For iteration over a generic list, use this code.<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to explain  iteration over a generic list</div>

	<pre class="brush: java">List&lt;String&gt; list = new ArrayList&lt;String&gt;;
Iterator&lt;String&gt; iterator = list.iterator();
while(iterator.hasNext()){
  String aString = iterator.next();
}</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 </blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/866-generic-list-java.html</guid>
		</item>
		<item>
			<title><![CDATA[Java's Generic For Loop]]></title>
			<link>http://www.java-forums.org/blogs/advanced-java/865-javas-generic-loop.html</link>
			<pubDate>Sat, 18 Feb 2012 14:40:12 GMT</pubDate>
			<description>Generic consists of “new for loop”, that is known as “for each loop”. New for loop iterates the generic collections and also supports to integrate....</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">Generic consists of “new for loop”, that is known as “for each loop”. New for loop iterates the generic collections and also supports to integrate. Iteration over a List or Generic set is explained by this code: <br />
Generic List gets iterated by this code: <br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to explain the Generic For Loop</div>

	<pre class="brush: java">List&lt;String&gt; list = new ArrayList&lt;String&gt;;
for(String aString : list) {
    System.out.println(aString);
}</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 For loop parenthesis, declaration of a String variable is done. Current &amp; new values are present in this variable, at every iteration.<br />
<br />
Generic Set is iterated by this code: <br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to explain the iteration</div>

	<pre class="brush: java">Set&lt;String&gt; set = new HashSet&lt;String&gt;;
for(String aString : set) {
    System.out.println(aString);
}</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 </blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/865-javas-generic-loop.html</guid>
		</item>
		<item>
			<title>Generic Methods and Constructors</title>
			<link>http://www.java-forums.org/blogs/advanced-java/864-generic-methods-constructors.html</link>
			<pubDate>Sat, 18 Feb 2012 14:37:48 GMT</pubDate>
			<description>Within methods declaration of the type parameters could be done and constructor signatures for creation of the generic constructors or generic...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">Within methods declaration of the type parameters could be done and constructor signatures for creation of the generic constructors or generic methods.<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to explain Generic Methods</div>

	<pre class="brush: java">public class Box&lt;T&gt; {

    private T t;          

    public void add(T t) {
        this.t = t;
    }

    public T get() {
        return t;
    }

    public &lt;U&gt; void inspect(U u){
        System.out.println(&quot;T: &quot; +
            t.getClass().getName());
        System.out.println(&quot;U: &quot; +
            u.getClass().getName());
    }

    public static void main(String&#91;&#93; args) {
        Box&lt;Integer&gt; integerBox = 
            new Box&lt;Integer&gt;();
        integerBox.add(new Integer(10));
        integerBox.inspect(&quot;some text&quot;);
    }
}</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 The output from this program is:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  Output of above program</div>

	<pre class="brush: java">T: java.lang.Integer
U: java.lang.String</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 </blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/864-generic-methods-constructors.html</guid>
		</item>
		<item>
			<title>Different Java Generic Types</title>
			<link>http://www.java-forums.org/blogs/advanced-java/863-different-java-generic-types.html</link>
			<pubDate>Sat, 18 Feb 2012 14:35:20 GMT</pubDate>
			<description><![CDATA[By using Generics, implementation of Box class is done. It is shown in the given code 
 
 
public class Box<T> { 
 
    // T stands for "Type" 
   ...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">By using Generics, implementation of Box class is done. It is shown in the given code<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code: </div>

	<pre class="brush: java">public class Box&lt;T&gt; {

    // T stands for &quot;Type&quot;
    private T t;

    public void add(T t) {
        this.t = t;
    }

    public T get() {
        return t;
    }
}</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 In given Box class replacement takes place with T, of all occurrences objects.<br />
<br />
For referencing the given generic class in your code you shall be performing generic type invocation that makes the replacement of T, with a concrete value like an Integer:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code: </div>

	<pre class="brush: java">Box&lt;Integer&gt; integerBox;
integerBox = new Box&lt;Integer&gt;();</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 Or entire statement could be place in 1 line, like:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code: </div>

	<pre class="brush: java">Box&lt;Integer&gt; integerBox = new Box&lt;Integer&gt;();</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 </blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/863-different-java-generic-types.html</guid>
		</item>
		<item>
			<title>What is Java Generics?</title>
			<link>http://www.java-forums.org/blogs/advanced-java/862-what-java-generics.html</link>
			<pubDate>Sat, 18 Feb 2012 14:32:52 GMT</pubDate>
			<description>Java provides support to the Generic features of JV. For specification of the concrete types to certain general methods or classes, Generics is used....</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">Java provides support to the Generic features of JV. For specification of the concrete types to certain general methods or classes, Generics is used.<br />
<br />
Above given definition is an abstract definition. For better understanding, consider few examples.<br />
Object instances are stored by the help of List interface. Therefore one can do storage and also place objects in a List. E.g.<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code: </div>

	<pre class="brush: java">List list = new ArrayList();
list.add(new Integer(2));
list.add(&quot;String&quot;);</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 These objects can also be casted that were added to list, as it is given below.<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code: </div>

	<pre class="brush: java">Integer integer = (Integer) list.get(0);
String  string   = (String) list.get(1);</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 Sometimes single type objects are being stored. Type of collection can be set in Java Generics.<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to </div>

	<pre class="brush: java">List&lt;String&gt; strings = new ArrayList&lt;String&gt;();
strings.add(&quot;a String&quot;);
String aString = strings.get(0);</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 </blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/862-what-java-generics.html</guid>
		</item>
		<item>
			<title>Getting Java Heap Size</title>
			<link>http://www.java-forums.org/blogs/advanced-java/861-getting-java-heap-size.html</link>
			<pubDate>Sat, 18 Feb 2012 14:29:59 GMT</pubDate>
			<description>In JVM, heap size is considered as a main area. New objects are stored or created here. To get heap size, see this Java code. We will also be...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">In JVM, heap size is considered as a main area. New objects are stored or created here. To get heap size, see this Java code. We will also be considering various memory methods.<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Java Code:  This is the code to get the heap size in Java</div>

	<pre class="brush: java">// Get current size of heap in bytes
long heapSize = Runtime.getRuntime().totalMemory();

// Get maximum size of heap in bytes. The heap cannot grow beyond this size.
// Any attempt will result in an OutOfMemoryException.
long heapMaxSize = Runtime.getRuntime().maxMemory();

// Get amount of free memory within the heap in bytes. This size will increase
// after garbage collection and decrease as new objects are created.
long heapFreeSize = Runtime.getRuntime().freeMemory();</pre>
	<script type="text/javascript">mh_sh_highlight_all('java');</script>

</div>
 </blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/861-getting-java-heap-size.html</guid>
		</item>
		<item>
			<title>Understanding Java Memory Settings</title>
			<link>http://www.java-forums.org/blogs/advanced-java/860-understanding-java-memory-settings.html</link>
			<pubDate>Sat, 18 Feb 2012 14:28:12 GMT</pubDate>
			<description><![CDATA[-Xmx & -Xms parameters set memory. Here discussion would be done regarding such parameters that why they are used to set memory. 
 
JVM i.e. Java...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">-Xmx &amp; -Xms parameters set memory. Here discussion would be done regarding such parameters that why they are used to set memory.<br />
<br />
JVM i.e. Java Virtual Machine is produced in system memory, when Java starts. Execution as well as complete process of Java program occurs in JVM. Java applications have 64MB memory, by default.<br />
<br />
In JVM, Xms is minimum heap size. If high sized initial memory is set, this might help a lot. Like,<br />
<br />
<ul><li style="">GC would be made to work lesser, that is much more efficient.</li><li style="">Initially, if memory size has been set higher then there would be no need to grow fast like memory size.</li><li style="">JVM’s overhead is saved so that to ask for enough more memory.</li></ul><br />
<br />
In JVM, maximum memory size is specified by using Xmx. When JVM is closed to full utilization of initial memory Xmx settings are being checked to known if more memory could be drawn out from system resources.<br />
<br />
Allocation of memory is considered to be a very expensive operation in JVM. GC is used for reallocation of memory when JVM gets close to initial memory.</blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/860-understanding-java-memory-settings.html</guid>
		</item>
		<item>
			<title>Java Garbage Collection</title>
			<link>http://www.java-forums.org/blogs/advanced-java/859-java-garbage-collection.html</link>
			<pubDate>Sat, 18 Feb 2012 14:26:33 GMT</pubDate>
			<description>Java provides support for its memory management by using its built-in mechanism. In Garbage collector, two threads run. 
 
•	Responsibility of 1st...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">Java provides support for its memory management by using its built-in mechanism. In Garbage collector, two threads run.<br />
<br />
•	Responsibility of 1st thread is memory collections, primarily heap. It is quite light weighted.<br />
•	2nd thread is considered to be a full “GC thread”. When comes memory shortage, entire heap is <br />
traversed by it. Spaces for the objects are allocated by it.<br />
<br />
When there is inadequate heap allocation or memory leak then full GC thread runs on continuous basis. Such process would stop the world. In that case requests will not get response by the resin.<br />
<br />
Memory that has been specified along with –Xmn is that amount which is for Eden generation allocation. For old generation, the amount that has been allocated is –Xmx minus –Xmn.</blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/859-java-garbage-collection.html</guid>
		</item>
		<item>
			<title>How to manage Java Heap Size?</title>
			<link>http://www.java-forums.org/blogs/advanced-java/858-how-manage-java-heap-size.html</link>
			<pubDate>Sat, 18 Feb 2012 14:25:07 GMT</pubDate>
			<description>You can specify the memory allocation for JVM using –X option. Following table explains the JVM options. 
 
*-Xms:*	initial java heap size ...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">You can specify the memory allocation for JVM using –X option. Following table explains the JVM options.<br />
<br />
<b>-Xms:</b>	initial java heap size <br />
<b>-Xmx:</b>	maximum java heap size <br />
<b>-Xmn:</b>	the size of the heap for the young generation <br />
<br />
unix&gt; bin/httpd.sh -Xmn100M -Xms500M -Xmx500M<br />
win&gt; bin/httpd.exe -Xmn100M -Xms500M -Xmx500M<br />
install win service&gt; bin/httpd.exe -Xmn100M -Xms500M -Xmx500M -install<br />
<br />
To set max –Xmx and min –Xms heap sizes at same value is a good practice for applications that are server side Java applications. For example, Resin.<br />
<br />
Heap size is not used to determine memory used by processes.</blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/858-how-manage-java-heap-size.html</guid>
		</item>
		<item>
			<title>Java memory management</title>
			<link>http://www.java-forums.org/blogs/advanced-java/857-java-memory-management.html</link>
			<pubDate>Sat, 18 Feb 2012 14:22:00 GMT</pubDate>
			<description>There are 2 categories of Java memory management problems which are as following: 
 
1.	In-complete deallocation 
2.	Pre-mature deallocation 
...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">There are 2 categories of Java memory management problems which are as following:<br />
<br />
1.	In-complete deallocation<br />
2.	Pre-mature deallocation<br />
<br />
Incomplete deallocation has been divided into 2 subclasses which are:<br />
<br />
1.	Desing bugs<br />
2.	Coding bugs<br />
<br />
Coding bugs are considered to be dependent upon language whereas design bugs are not language dependent. They are programming mistakes. Usually programmer is involved in handling the memory management in languages, e.g. C++.<br />
<br />
Java Runtime and Java language remove the corrupted pointer problems and also other memory leaks of code level. Explanation that how it takes place is as following:<br />
<br />
•	“Explicit” memory allocation in Java is not present. It is allocated to objects only. <br />
•	Java contains a low priority thread called Garbage Collector. It is responsible for releasing occupied memory by an object when it is not accessible. It helps to collect all the unused memory.<br />
•	From complete object tree, one can make memory released in Java. This is done by making root null. All memory &amp; objects would be collected as well as reclaimed by the Garbage collector.</blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/857-java-memory-management.html</guid>
		</item>
		<item>
			<title>High Load Web Servlets Performance Tips</title>
			<link>http://www.java-forums.org/blogs/advanced-java/856-high-load-web-servlets-performance-tips.html</link>
			<pubDate>Sat, 18 Feb 2012 14:19:43 GMT</pubDate>
			<description>•	Do not redirect request from the servlet. Always send requests directly from static resources to the web server using URL. 
•	Use different web...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">•	Do not redirect request from the servlet. Always send requests directly from static resources to the web server using URL.<br />
•	Use different web servers for dynamic and static content.<br />
•	Use cache to store content.<br />
•	Manage your RAM to cache content.<br />
•	Use multiple JVMs to balance the load.<br />
•	Limit the number of file descriptors. <br />
•	Do not avoid logging to improve performance. It is more important.<br />
•	Always monitor resources.</blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/856-high-load-web-servlets-performance-tips.html</guid>
		</item>
		<item>
			<title>JMS Performance Tips</title>
			<link>http://www.java-forums.org/blogs/advanced-java/855-jms-performance-tips.html</link>
			<pubDate>Sat, 18 Feb 2012 14:17:27 GMT</pubDate>
			<description>•	To avoid message queue, start consumer before producer. 
•	To process messages, use ConnectionConsumer with ServerSessionPool. 
•	Close all...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">•	To avoid message queue, start consumer before producer.<br />
•	To process messages, use ConnectionConsumer with ServerSessionPool.<br />
•	Close all resources explicitly like connections, sessions, objects etc.<br />
•	Non-transactional as well as transactional sessions should be used for non-transactional &amp; transactional messages.<br />
•	Destination parameters shall be tuned.<br />
•	For messages to be received asynchronously, MessageListener shall be implemented.<br />
•	Select NON_PERSISTENT messages for avoidance of the overhead persistency.<br />
•	Minimum value for TimeToLive shall be set.<br />
•	Use transient variables.</blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/855-jms-performance-tips.html</guid>
		</item>
		<item>
			<title>EJB Performance Tips</title>
			<link>http://www.java-forums.org/blogs/advanced-java/854-ejb-performance-tips.html</link>
			<pubDate>Sat, 18 Feb 2012 14:16:12 GMT</pubDate>
			<description>•	Tune EJB calls. They are expensive. 
•	Use Plain Java Object (POJO), when you do not need an EJB. 
•	If EJB client and EJB are deployed on same...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">•	Tune EJB calls. They are expensive.<br />
•	Use Plain Java Object (POJO), when you do not need an EJB.<br />
•	If EJB client and EJB are deployed on same JVM, then use Local Interface.<br />
•	Multiple entity beans must be wrapped in one session bean to reduce remote calls.<br />
•	Use transient with unnecessary data variables to avoid network overhead.<br />
•	Always cache to EJBHome references so that do not need to lookup JNDI each time.<br />
•	Set transaction time out.<br />
•	Use clustering.<br />
•	Use HttpSession intead of Stateful session bean.<br />
•	Use ejbCreate() method to cache bean resources.</blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/854-ejb-performance-tips.html</guid>
		</item>
		<item>
			<title>Servlet Performance Tips</title>
			<link>http://www.java-forums.org/blogs/advanced-java/853-servlet-performance-tips.html</link>
			<pubDate>Sat, 18 Feb 2012 14:14:58 GMT</pubDate>
			<description>•	Cache static data using jspInit() method. 
•	Release static data in jspDestroy() method. 
•	To concatenate string use, StringBuffer. 
•	Do not use...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">•	Cache static data using jspInit() method.<br />
•	Release static data in jspDestroy() method.<br />
•	To concatenate string use, StringBuffer.<br />
•	Do not use println() method.<br />
•	Do not use PrintWriter to send binary data. Use ServletOutputStream.<br />
•	Always flush data in sections.<br />
•	Use getLastModified() method to handle browser and server cache.<br />
•	Use application server cache.<br />
•	Use session in following order: HttpSession, Hidden fields, Cookies, URL rewriting.<br />
•	Always remove HttpSession explicitly.<br />
•	Disable Servlet auto reloading.</blockquote>

]]></content:encoded>
			<dc:creator>Advanced Java</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/advanced-java/853-servlet-performance-tips.html</guid>
		</item>
	</channel>
</rss>
