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 2:51

try {
    Do {
        ***
    } while (true);
} catch (Exception e) {}

That'll do you. Also, write code that doesn't suck in a language that doesn't. You should be able to tell when you hit the EOF and put that into your while loop and smoke it.

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