Ed Thompson <> wrote on Sat, 31 Jul 2004
23:01:39 GMT in comp.lang.java.programmer:
>So now I have an interpretation issue. Does this really mean that
>inside() is faster than outside()? Is one really more optimal?
Whatever difference in speed there might be would be so infinitesimal
that it wouldn't be worth worrying about, IMO. I would always declare
the variable inside the loop since it's less bug prone than outside,
particularly if you're working with nested loops.
Besides, another compiler might optimize the code in such a way that
the the actual bytecode is identical for the two methods.
--
Check out QueryForm, a free, open source, Java/Swing-based
front end for relational databases.
http://qform.sourceforge.net