Disable Web-sphere portlet container

Websphere 6.1 and above comes with in-built portlet container. Websphere load portlet api with all web application. There is no settings in adminstraive console to disable portlet container, it is an over-ahead on memory. This specifically make an problem or java based portal server e.g  jetspeed-2 , Liferay etc. There is only one way to disable it. You add the following context param to disable portlet container for your web application. This also saves the memory foot print.

  <context-param>
     <param-name>com.ibm.websphere.portletcontainer.PortletDeploymentEnabled</param-name>
     <param-value>false</param-value>
   </context-param>

For Each loop in java 1.5

The for-each loop, or enhanced for loop, is new feature in JDK 1.5 to remove clutter and possible errors, in iterating over collections.This will not provide any new functionality .It is just making our code more easy.It allow to create one variable which will iterate over array or collection.By this we can do nested iteration.

JDK 5.0 provides a special kind of for loop for access through all the elements of it.

 
Syntax 

For(vaiable : collection){ Statements; } 
Example:

  int[] a={1,2,3,4,5,6,7,8,9,0};
Using for Each loop :-

  for(int i : a){
    System.out.println(i);</em>
  }  

using Simple for loop :-

for(Iterator itr = a.iterator(); i.hasNext(); ) {
  String item = i.next();
  System.out.println(item);one more example will clear you more on this.

Using Foreach with Arrays  :-

String[] letters = { "v", "i", "n" , "a" , "y" };
for (String letter: letters)
   System.out.println(letter.charAt(0));

Autoboxing In java

Automatic conversion of primitive types and their corresponding object wrapper classes (eg, int and Integer, double and Double, etc).
Autoboxing is a new feature java 1.5 . It is a capability to convert or cast between object wrapper and it’s primitive type.it was necessary to wrap a primitive type to a Wrapper class before adding it to a collection i.e is called Boxing and to unwrap it back to the primitive when it came out of the collection i.e unboxing.

Auto-boxing and Auto-Unboxing enables the primitive types to be converted into respective wrapper objects and the other way around.
Before jdk 1.5 we need to manual boxing.We have to write tedious coding for that.

example-
Integer vinay();

int i = vinay();

Difference between autoboxing and Casting

Boxing – Boxing is when you use or make primitive type to a reference type
Casting – Casting is when you want one type to treated as another type, between primitive types and reference types