ArrayList Generics

Hi,

First of all I'm new to generics so this may be a basic question. I have this:

ArrayList<Message> alMessage = hibernateFacade.getPost(new Long(postId));

Now, in theold fashioned way I would do:

for(int i = 0; i < alMessage.size(); i++){

Message m = (Message)alMessage.get(i);

//work the methods

}

The question is: is there other way to do this(more fancy)?

Thanks in advance,

Manuel Leiria

[652 byte] By [manuel.leiriaa] at [2007-11-26 17:45:16]
# 1
http://java.sun.com/j2se/1.5.0/docs/guide/language/foreach.html
suparenoa at 2007-7-9 0:13:27 > top of Java-index,Java Essentials,Java Programming...
# 2
> http://java.sun.com/j2se/1.5.0/docs/guide/language/for> each.htmlI've got it!thanks,Manuel Leiria
manuel.leiriaa at 2007-7-9 0:13:27 > top of Java-index,Java Essentials,Java Programming...