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 5:05

>>2, also use for (;;) { ... } for infinite looping, it's simpler.

Also, exceptions are glorified gotos. People managed to turn "Goto considered harmful" into "Exceptions considered best practice", when they are pretty much the same. The only difference between exceptions and goto is you get automatic if (shit_happened) goto fuckfuckfuck; .


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