How to make a try-catch block that iterates through all objects of a list and keeps on calling a met

Posted by aperson on Stack Overflow See other posts from Stack Overflow or by aperson
Published on 2010-04-19T21:35:53Z Indexed on 2010/04/19 21:43 UTC
Read the original article Hit count: 367

Basically iterating through a list and,
- Invoke method on first object
- Catch first exception (if any); if there are no more exceptions to catch, return normally. Otherwise, keep on invoking method until all exceptions are caught.
- Move on to next object.

I can iterate through each object, invoke the method, and catch one exception but I do not know how to continuously invoke the method on it and keep on catching exceptions :S

Thanks :)

© Stack Overflow or respective owner

Related posts about java

Related posts about try-catch