Skip to content

Instantly share code, notes, and snippets.

@yishai-glide
Created August 26, 2015 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yishai-glide/cc478358bf2ed9d6fa2b to your computer and use it in GitHub Desktop.
Save yishai-glide/cc478358bf2ed9d6fa2b to your computer and use it in GitHub Desktop.
try {
ArrayList<Object> list = getListOfPreExistingItems();
for(int i = 0; ; i++) {
Object item = list.get(i)
doSomething(item);
}
} catch (ArrayOutOfBoundsException e) {
// loop is over
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment