You can write a program yourself to test the performance of those two pieces of code. Or you can compile both pieces of code, decompile them into readable Java byte code with javap, and see if there's any difference in the byte code.
Anyway, I bet that there is no noticeable difference, if there's any difference at all.
Are you attempting to do micro-optimizations yourself? This kind of optimization does not look like something that is worth spending a lot of time on if you're trying to make your program run faster.
If you want to optimize your program, then do this:
1. Analyze the algorithms that you are using in your program. Are you using the most efficient algorithm for the job? If not, use a better algorithm.
2. Run the program through a profiler to find the performance and/or memory usage bottlenecks. Concentrate on that part of your code that causes the bottlenecks. [ October 09, 2006: Message edited by: Jesper Young ]