Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Java Loop

Name: Anonymous 2007-02-20 1:41

Is it possible to run a do/while loop in java until an exception is thrown? As in:

try {
    Do {
        ***
    } while ("NO EXCEPTION");
} catch (Exception e) {}

Example being that I'm saving a ArrayList and would like to read from that file all items using .add.readObject() without knowing the file length.

Name: Anonymous 2007-02-20 7:10

>>1

If you do that, you are not a master programmer.  In fact, you are an idiot.  Test for a proper condition in your while, or break out of the middle of the loop if you must.  Remember-- you aren't the only person who gets to throw exceptions in your code.  The runtime can too.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List