Should I correct the problem like follows?
old version
ArrayList al=new ArrayList(); // why do your instantiate an instance here?
MyObject mo=new MyObject(); // why do your instantiate an instance here?
TestArrayList tal=new TestArrayList();
al=tal.getObjectList();
new version
public static void main(String[] args) {
// TODO Auto-generated method stub
TestArrayList tal=new TestArrayList();
ArrayList al =tal.getObjectList();
MyObject mo;
for(int i=0;i<al.size();i++)
{
mo=(MyObject) al.get( i );
System.out.print( i );
System.out.print(":");
System.out.print(mo.getItemCode());
System.out.print("---");
System.out.println(mo.getItemName());
}
}